UTMIST / oneshot-rs

A Rust implementation of Siamese Neural Networks for One-shot Image Recognition for benchmarking performance and results.
MIT License
1 stars 0 forks source link
machine-learning ml omniglot one-shot one-shot-learning rust

Rust for Machine Learning: Benchmarking Performance in One-shot

A Rust implementation of Siamese Neural Networks for One-shot Image Recognition for benchmarking performance and results.

Abstract

Python is a very flexible scripting language, suitable for machine learning experiments. However, it's widely known that the semantic properties of Python and of interpreted languages in general do not lend themselves well in performance, frugality, or scaling. While various Python libraries have been implemented in performant languages such as C++, there may remain sizeable gains in performance, safety, and efficiency in using modern performant languages directly. Rust is a language that in 2020 seems mature enough to begin to be used seriously. We aim to implement Siamese Neural Networks for One-shot Image Recognition using both Rust and Python (with popular libraries) and to compare their performance, efficiency, and anomalies (errors and discrepancies) to hopefully provide insight into whether or not it's worth using a more difficult programming language.

Setup

You can expedite the setup and run the basic test cases using cargo test.

Submodules

git submodule update --init

Unpacking Dataset

Review the contents of oneshot-data/data_augmented and choose a <background-dataset> from the *background* datasets.

unzip oneshot-data/data_augmented/<background-dataset>.zip

Running the Code

To select <num-background-pairs> pairs of images from <background-dataset> for a background set, run the following script.

cargo run -- <dataset-directory> <num-pairs>

Library Modules

Repositories & Resources

References

Lake, B. M., Salakhutdinov, R., and Tenenbaum, J. B. (2015). Human-level concept learning through probabilistic program induction. Science, 350(6266), 1332-1338.