Skip to content

Commit

Permalink
fix repeate to repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
burness committed Oct 29, 2016
1 parent ea2f3a7 commit d796407
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/images/inception_resnet_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import tflearn
from tflearn.layers.core import input_data, dropout, flatten, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d, avg_pool_2d
from tflearn.utils import repeate
from tflearn.utils import repeat
from tflearn.layers.merge_ops import merge
from tflearn.data_utils import shuffle, to_categorical
import tflearn.activations as activations
Expand Down Expand Up @@ -115,15 +115,15 @@ def block8(net, scale=1.0, activation='relu'):

tower_5b_out = merge([tower_conv, tower_conv1_1, tower_conv2_2, tower_conv3_1], mode='concat', axis=3)

net = repeate(tower_5b_out, 10, block35, scale=0.17)
net = repeat(tower_5b_out, 10, block35, scale=0.17)

tower_conv = conv_2d(net, 384, 3, strides=2,activation='relu', padding='VALID', name='Conv2d_6a_b0_0a_3x3')
tower_conv1_0 = conv_2d(net, 256, 1, activation='relu', name='Conv2d_6a_b1_0a_1x1')
tower_conv1_1 = conv_2d(tower_conv1_0, 256, 3, activation='relu', name='Conv2d_6a_b1_0b_3x3')
tower_conv1_2 = conv_2d(tower_conv1_1, 384, 3, strides=2, padding='VALID', activation='relu',name='Conv2d_6a_b1_0c_3x3')
tower_pool = max_pool_2d(net, 3, strides=2, padding='VALID',name='MaxPool_1a_3x3')
net = merge([tower_conv, tower_conv1_2, tower_pool], mode='concat', axis=3)
net = repeate(net, 20, block17, scale=0.1)
net = repeat(net, 20, block17, scale=0.1)

# aux = avg_pool_2d(net, 5, strides=3, padding='VALID', name="AvgPool2D")
# aux = conv_2d(aux, 128,1, activation='relu', name='Conv2d_1b_1x1')
Expand All @@ -144,7 +144,7 @@ def block8(net, scale=1.0, activation='relu'):
tower_pool = max_pool_2d(net, 3, strides=2, padding='VALID', name='MaxPool_1a_3x3')
net = merge([tower_conv0_1, tower_conv1_1,tower_conv2_2, tower_pool], mode='concat', axis=3)

net = repeate(net, 9, block8, scale=0.2)
net = repeat(net, 9, block8, scale=0.2)
net = block8(net, activation=None)

net = conv_2d(net, 1536, 1,activation='relu', name='Conv2d_7b_1x1')
Expand Down
4 changes: 2 additions & 2 deletions tflearn/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ def autoformat_kernel_3d(kernel):
raise Exception("kernel format error: " + str(type(kernel)))


def repeate(inputs, repetitions, layer, *args, **kwargs):
def repeat(inputs, repetitions, layer, *args, **kwargs):
outputs = inputs
for i in range(repetitions):
outputs = layer(outputs, *args, **kwargs)
return outputs
return outputs

0 comments on commit d796407

Please sign in to comment.