Distributed Evolutionary Algorithms in TensorFlow (DEATF) is a framework where networks generated with TensorFlow are evolved via DEAP.
Project description
DEATF
Distributed Evolutionary Algorithms in TensorFlow (DEATF) is a framework where networks generated with TensorFlow [1] are evolved via DEAP [2]. DEATF is a framework directly based in EvoFlow [3] framework created by Unai Garciarena.
Installation
DEATF has available an easy installation with pip.
pip install deap
Requirements
TensorFlow DEAP NumPy Tensorflow-database ScikitLearn Pandas
Example
The easiest example of this library (taken from simple.py in the examples folder), where every used parameter is predifined is the following one:
import numpy as np
from deatf.auxiliary_functions import load_fashion
from deatf.network import MLPDescriptor
from deatf.evolution import Evolving
from sklearn.preprocessing import OneHotEncoder
x_train, y_train, x_test, y_test, x_val, y_val = load_fashion()
OHEnc = OneHotEncoder()
y_train = OHEnc.fit_transform(np.reshape(y_train, (-1, 1))).toarray()
y_test = OHEnc.fit_transform(np.reshape(y_test, (-1, 1))).toarray()
y_val = OHEnc.fit_transform(np.reshape(y_val, (-1, 1))).toarray()
e = Evolving(evaluation="XEntropy", desc_list=[MLPDescriptor], compl=False,
x_trains=[x_train], y_trains=[y_train], x_tests=[x_val], y_tests=[y_val],
n_inputs=[[28, 28]], n_outputs=[[10]], batch_size=150, iters=10,
population=15, generations=10, max_num_layers=10, max_num_neurons=20,
seed=0, dropout=False, batch_norm=False, evol_alg='mu_plus_lambda',
evol_kwargs={'mu':10, 'lambda_':15, 'cxpb':0., "mutpb": 1.},
sel = 'best')
a = e.evolve()
References
[1] Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., ... & Ghemawat, S. (2016). Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467.
[2] Fortin, F. A., Rainville, F. M. D., Gardner, M. A., Parizeau, M., & Gagné, C. (2012). DEAP: Evolutionary algorithms made easy. Journal of Machine Learning Research, 13(Jul), 2171-2175.
[3] Garciarena, U., Santana, R., & Mendiburu, A. (2018, July). Evolved GANs for generating Pareto set approximations. In Proceedings of the Genetic and Evolutionary Computation Conference (pp. 434-441). ACM.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file deatf-0.2.tar.gz
.
File metadata
- Download URL: deatf-0.2.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb6fa84e80a478d3f8d4f244869280eac4359a0d0982fa778c3d759b0747abac |
|
MD5 | 9c920356c0bb2e9724f34609b3904c31 |
|
BLAKE2b-256 | e9f99a9c69c278b3f374bed73bc107cdc2e57f0838163892951dd606eeb59646 |
File details
Details for the file deatf-0.2-py3-none-any.whl
.
File metadata
- Download URL: deatf-0.2-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a54b72665f28dba9e0833f5305b0ebaebcd7d727bf419551e08bb3913929b68 |
|
MD5 | 0bc3e645d87e95690f407bd832079d5f |
|
BLAKE2b-256 | db32ab680742e16e888b28103d2b60737052649d7d35660d7070389be4450d06 |