Skip to main content

EasyNAS - a simple and effective CNN architecture generator

Purpose

Given a dataset, this python package will utilize genetic algorithms and Pytorch to optimize the structure a simple CNN for the task of classification. With simple meaning that the generated architecture is built of a series of layers, where each layers input is the output the previous one.

Installation

pip install easynas

Input data format

The input data should be split into training and validation sets, with the following dimensions:

[#samples, #channels, height, width]

This means that 2D image-like data is the expected input. If dealing, for example, with 1D time series data that contains a 'channels' dimension, one should include an extra dimension as such (example with numpy):

X = X[:, :, :, None]

Usage example

from easynas.genetic_algorithm import EasyNASGA
import torchvision
from sklearn.model_selection import train_test_split

train_data = torchvision.datasets.MNIST('/files/', train=True, download=True)
test_data = torchvision.datasets.MNIST('/files/', train=False, download=True)
X_train = train_data.data[:, None, :, :].float()
y_train = train_data.targets.float()
X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=0.2, random_state=42)
easyga = EasyNASGA(X_train, y_train, X_val, y_val, generations=5, population_size=10, max_epochs=1, weight_inheritance=True)
easyga.ga.run()
best_individual = easyga.get_best_individual()
print(f'best individual: {best_individual}')

Credits

Anyone using this package for research/production purposes is requested to cite the following research articles:

Rapaport, E., Poese, I., Zilberman, P., Holschke, O., & Puzis, R. (2020).
Predicting traffic overflows on private peering.
arXiv preprint arXiv:2010.01380.

https://arxiv.org/abs/2010.01380

Rapaport, Elad, Oren Shriki, and Rami Puzis.
"EEGNAS: Neural Architecture Search for Electroencephalography Data Analysis and Decoding."
International Workshop on Human Brain and Artificial Intelligence.
Springer, Singapore, 2019.

https://link.springer.com/chapter/10.1007/978-981-15-1398-5_1

Release files for easynas 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easynas 0.2.1
File Size Uploaded
easynas-0.2.1.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for easynas 0.2.1
File Interpreter ABI Platform
easynas-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / easynas-0.2.1.tar.gz

Download URL easynas-0.2.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c2a42682e39c5c0f3efbed44867257edc0bb6b775643d1f7f544b768b7ba7595
BLAKE2b-256 checksum
How to use checksums
acda92e4f188924f06e9752d13dc6f9ea6f015b265486bd53c0b4a7d61041ce6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / easynas-0.2.1-py3-none-any.whl

Download URL easynas-0.2.1-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1ea4e88536896723130b5d8aa43760945f6610d817d0ac5b5391652e99131bd
BLAKE2b-256 checksum
How to use checksums
2e1e6ed5a71f19e5984e85055d6f69545492fbd25135f0a19e70d4ffe42e038e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page