Commit 1e08b679 authored by Felix Bragman's avatar Felix Bragman

ability for dropout in FC layers in graph

parent d156c501
Pipeline #12602 failed with stages
in 9 seconds
......@@ -60,8 +60,8 @@ class VGG16Net(BaseNet):
{'name': 'maxpool_4'},
{'name': 'layer_5', 'n_features': 512, 'kernel_size': 3, 'repeat': 3},
{'name': 'maxpool_5'},
{'name': 'fc_1', 'n_features': 4096},
{'name': 'fc_2', 'n_features': 4096},
{'name': 'fc_1', 'n_features': 4096, 'p': 0.5},
{'name': 'fc_2', 'n_features': 4096, 'p': 0.5},
{'name': 'fc_3', 'n_features': self.num_classes}]
def layer_op(self, images, is_training=True, layer_id=-1, **unused_kwargs):
......@@ -131,7 +131,13 @@ class VGG16Net(BaseNet):
w_initializer=self.initializers['w'],
w_regularizer=self.regularizers['w'],
)
flow = fc_layer(flow)
if 'p' in layer:
dropout_p = layer['p']
flow = fc_layer(flow, keep_prob=dropout_p)
else:
flow = fc_layer(flow)
layer_instances.append((fc_layer, flow))
if is_training:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment