Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swimnetworks-0.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

swimnetworks-0.0.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page