Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Add a simple example for SiameseDataset #531

Merged
merged 2 commits into from
Mar 5, 2018

Conversation

yuyu2172
Copy link
Member

@yuyu2172 yuyu2172 commented Mar 2, 2018

No description provided.

>>> dataset = SiameseDataset(mnist, mnist, pos_ratio=0.3)
# The probability of the two samples having the same label
# is 0.3 as specified by pos_ratio.
>>> img_0, label_0, img_1, label_1 = dataset[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to show that SiameseDataset returns examples randomly.
How about adding following lines?

...
>>> img_0, label_0, img_1, label_1 = dataset[0]
Note that the returned examples may change in the next call because :class:`SiameseDataset` picks examples randomly.
>>> img_0_new, label_0_new, img_1_new, label_1_new = dataset[0]
In this case, :obj:`img_0_new` may differ :obj:`img_0`.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, differ -> differ from.

Copy link
Member

@Hakuyume Hakuyume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hakuyume Hakuyume merged commit b52f020 into chainer:master Mar 5, 2018
@yuyu2172 yuyu2172 added this to the v0.9 milestone Mar 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants