A implementation of the paper : Siamese Neural Networks for One-shot Image Recognition using pytorch. In the model, somethings, such as learning rates or regression, may differ from the original paper.
You can run one shot learning step by step. Also, I posted the details of the code in Korean on my blog.
한글로 논문과 코드에 대해 작성한 글이 있으니 관심있으신 분은 확인해보세요!
You can execute three action. just run, download-data, train, test.
-
cd siamese
-
This commend automatically executes the entire process according to
config_maker
(download data + train + test).If you just want to try this network, I recommend this.
python main.py run
-
The Omniglot data is downloaded and divided into 30 types of train data, 10 types of validation data, and 10 types of test data. All data is contained in
./data/processed/
.python main.py download-data
-
Only model learning is conducted. If you want to run 'train', you have to run 'download-data' first.
python main.py train
-
Only test the model. Stored models and datasets must exist.
python main.py test
All parameters are present in arguments.py
. If you want to adjust the parameters, modify them and run the code.
Train logs, saved model and configuration data were in ./result/[model_number]
. Logs are made by tensorboard
. So if
you want to see more detail about train metrics, write commend on ./siamese_network/result/[model_number]
like this.
tensorboard --logdir=logs