Skip to content

Commit

Permalink
- nicer printing
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmic committed Aug 21, 2019
1 parent c2f67d2 commit 2272f67
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mini_imagenet_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,6 @@ def all_layers(model):
layers.append(l)
return layers

for l in all_layers(siamese_net):
l2=l
if isinstance(l,TimeDistributed):
l2=l.layer
print(l2.name,l2.trainable, len(l2.get_weights()))

lambda_model_layers = all_layers(lambda_model)
for l in range(len(lambda_model_layers)):
l2=lambda_model_layers[l]
Expand All @@ -486,7 +480,7 @@ def all_layers(model):
p='timedi'
if args.enable_only_layers_of_list is not None:
l2.trainable = False
print(l, p,l2.name,l2.trainable, len(l2.get_weights()))
print('{:10} {:10} {:20} {:10} {:10}'.format(l, p,l2.name, ("fixed", "trainable")[l2.trainable], l2.count_params()))

if args.enable_only_layers_of_list is not None:
print('\nenable some layers for training')
Expand All @@ -500,7 +494,7 @@ def all_layers(model):
if isinstance(l2,TimeDistributed):
l2=l2.layer
p='timedi'
print(l, p,l2.name,l2.trainable, len(l2.get_weights()))
print('{:10} {:10} {:20} {:10} {:10}'.format(l, p,l2.name, ("fixed", "trainable")[l2.trainable], l2.count_params()))

#after loading to set learning rate
lambda_model.compile(loss='categorical_crossentropy', optimizer=op.SGD(args.lr), metrics=['categorical_accuracy'])
Expand Down

0 comments on commit 2272f67

Please sign in to comment.