Skip to content

Commit

Permalink
- added command line option for BiasLayers
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmic committed Aug 23, 2019
1 parent dea5ff3 commit 4a8a444
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions few_shot_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 4a8a444

Please sign in to comment.