SWIM training of neural networks.
Project description
swimnetworks implements the algorithm SWIM for sampling weights of neural networks. The algorithm provides a way to quickly train neural networks on a CPU. For more details on the theoretical background of the method, refer to our paper [1].
Installation
To install the main package with the requirements, one needs to clone the repository and execute the following command from the root folder:
pip install .
Example
Here is a small example of defining a sampled network:
from sklearn.pipeline import Pipeline
from swimnetworks import Dense, Linear
steps = [
("dense", Dense(layer_width=512, activation="tanh",
parameter_sampler="tanh",
random_seed=42)),
("linear", Linear(regularization_scale=1e-10))
]
model = Pipeline(steps)
Then, one can use model.fit(X_train, y_train)
and model.transform(X_test)
to train and evaluate the model.
The numerical experiments from [1] can be found in a separate repository.
Citation
If you use the SWIM package in your research, please cite the following paper:
Project details
Release history Release notifications | RSS feed
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
Hashes for swimnetworks-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b55e1aff51f696a448c012cbaad627e51f8a79d990b3a2cefe5d6b31285d5b86 |
|
MD5 | c27a0ffddba04fffb8e69425d49a4ee7 |
|
BLAKE2b-256 | 186ddac9c07a18f242701b14b760b8082aad298676084cb05cd7837f3f0b4d44 |