Skip to content

Commit 332e138

Browse files
committed
better description
1 parent 8c17275 commit 332e138

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

siamese_network/main.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ def __getitem__(self, index):
122122
images from the same class. For negative examples, we will have two images
123123
from different classes.
124124
125-
Given the index, if the index is even, we will pick the second image from the same class,
126-
but it won't be the same image we chose for the first class. This is used to ensure as it is easy
127-
for the network to notice that two images that are the same are positive examples. However, if
128-
we are given two different images from the same class, the network will need to learn the similarity
129-
between two different images representing the same class. If the index is odd, we will pick the second
130-
image from a different class than the first image.
125+
Given an index, if the index is even, we will pick the second image from the same class,
126+
but it won't be the same image we chose for the first class. This is used to ensure the positive
127+
example isn't trivial as the network would easily distinguish the similarity between same images. However,
128+
if the network were given two different images from the same class, the network will need to learn
129+
the similarity between two different images representing the same class. If the index is odd, we will
130+
pick the second image from a different class than the first image.
131131
"""
132132

133133
# pick some random class for the first image

0 commit comments

Comments
 (0)