From 4a8a444c88895e1b5c2535acc41bae85399d6bc1 Mon Sep 17 00:00:00 2001 From: detlef Date: Fri, 23 Aug 2019 18:18:14 +0200 Subject: [PATCH] - added command line option for BiasLayers --- few_shot_tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/few_shot_tests.py b/few_shot_tests.py index 61fb55f..723c273 100755 --- a/few_shot_tests.py +++ b/few_shot_tests.py @@ -32,6 +32,8 @@ parser.add_argument('--tensorboard_log_dir', dest='tensorboard_log_dir', type=str, default='./logs') parser.add_argument('--enable_only_layers_of_list', dest='enable_only_layers_of_list', type=str, default=None) parser.add_argument('--episode_test_sample_num', dest='episode_test_sample_num', type=int, default=15) +parser.add_argument('--biaslayer1', dest='biaslayer1', action='store_true') +parser.add_argument('--biaslayer2', dest='biaslayer2', action='store_true') args = parser.parse_args() @@ -220,11 +222,11 @@ def get_config(self): input1 = Input(shape=(None,84,84,3)) input2 = Input(shape=(None,84,84,3)) #, tensor = K.variable(episode_train_img[0:0])) -input2b = BiasLayer(shots * cathegories, mult_bias = 0)(input2) +input2b = BiasLayer(shots * cathegories, mult_bias = float(args.biaslayer1))(input2) encoded_l = model_img(input1) encoded_r = model_img(input2b) -encoded_rb = BiasLayer(shots * cathegories, mult_bias = 0)(encoded_r) +encoded_rb = BiasLayer(shots * cathegories, mult_bias = float(args.biaslayer1))(encoded_r) # Add a customized layer to compute the absolute difference between the encodings L1_layer = Lambda(lambda tensors:K.abs(tensors[0] - tensors[1])) L1_distance = L1_layer([encoded_l, encoded_rb])