MCPcopy Create free account
hub / github.com/Sentdex/pygta5 / resnext

Function resnext

original_project/models.py:155–175  ·  view source on GitHub ↗
(width, height, frame_count, lr, output=9, model_name = 'sentnet_color.model')

Source from the content-addressed store, hash-verified

153
154
155def resnext(width, height, frame_count, lr, output=9, model_name = 'sentnet_color.model'):
156 net = input_data(shape=[None, width, height, 3], name='input')
157 net = tflearn.conv_2d(net, 16, 3, regularizer='L2', weight_decay=0.0001)
158 net = tflearn.layers.conv.resnext_block(net, n, 16, 32)
159 net = tflearn.resnext_block(net, 1, 32, 32, downsample=True)
160 net = tflearn.resnext_block(net, n-1, 32, 32)
161 net = tflearn.resnext_block(net, 1, 64, 32, downsample=True)
162 net = tflearn.resnext_block(net, n-1, 64, 32)
163 net = tflearn.batch_normalization(net)
164 net = tflearn.activation(net, 'relu')
165 net = tflearn.global_avg_pool(net)
166 # Regression
167 net = tflearn.fully_connected(net, output, activation='softmax')
168 opt = tflearn.Momentum(0.1, lr_decay=0.1, decay_step=32000, staircase=True)
169 net = tflearn.regression(net, optimizer=opt,
170 loss='categorical_crossentropy')
171
172 model = tflearn.DNN(net,
173 max_checkpoints=0, tensorboard_verbose=0, tensorboard_dir='log')
174
175 return model
176
177
178def sentnet_color_2d(width, height, frame_count, lr, output=9, model_name = 'sentnet_color.model'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected