Skip to content

Commit

Permalink
- some experiments, not successfull
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmic committed Sep 23, 2019
1 parent 346d7c0 commit aefeb98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions few_shot_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def parser():
parser.add_argument('--EarlyStop', dest='EarlyStop', type=str, default='EarlyStop')
parser.add_argument('--max_idx', dest='max_idx', type=int, default=-1)
parser.add_argument('--dense_img_num', dest='dense_img_num', type=int, default=-1)
parser.add_argument('--binary_siamese', dest='binary_siamese', action='store_true')
parser.add_argument('--binary_siamese', dest='binary_siamese', action='store_true') #seems to be a bad idea
parser.add_argument('--square_siamese', dest='square_siamese', action='store_true')

args = parser.parse_args()

Expand Down Expand Up @@ -415,7 +416,10 @@ def get_config(self):
prediction = Dense(1, name = 'dense_siamese')(L1_distance)
else:
# Add a customized layer to compute the absolute difference between the encodings
L1_layer = Lambda(lambda tensors:K.abs(tensors[0] - tensors[1]))
if args.square_siamese:
L1_layer = Lambda(lambda tensors:K.pow(tensors[0] - tensors[1], 2))
else:
L1_layer = Lambda(lambda tensors:K.abs(tensors[0] - tensors[1]))
L1_distance = L1_layer([encoded_l, encoded_rb_scale])
prediction = Dense(1, name = 'dense_siamese')(L1_distance)

Expand Down

0 comments on commit aefeb98

Please sign in to comment.