A sparse autoencoder implementation in Python for the PyTorch library
Project description
Torch Sparse Autoencoder
A Python library for implementing sparse autoencoders using PyTorch.
Installation
pip install torch-sparse-autoencoder
Usage
from torch_sparse_autoencoder import SparseAutoencoderManager
# Create a sparse autoencoder
manager = SparseAutoencoderManager(
model=model,
layer=target_layer,
activation_dim=activation_dim,
sparse_dim=activation_dim*4,
device=device
)
# Train the autoencoder
manager.train(
torch_dataset,
num_epochs=5,
batch_size=4,
sparsity_weight=1e-3,
verbose=True
)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file torch_sparse_autoencoder-0.1.0.tar.gz.
File metadata
- Download URL: torch_sparse_autoencoder-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6695bb857bb288b989198c7c5b9832f071c672e19ddd1c10ba7fb8b39e718e7
|
|
| MD5 |
5ad891ad4df0491fc86b2393732faf02
|
|
| BLAKE2b-256 |
3e8b69f11d8e81534a736ca46481e642b464ba2dfefa732d7cae4d4e3229123a
|
File details
Details for the file torch_sparse_autoencoder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: torch_sparse_autoencoder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e554a886d5b49b1aa77e9c81b3468a5533aec473c8d3b1bae7126ab05f97e0
|
|
| MD5 |
79fdb04636ae9bfb6f7f6508a77236ab
|
|
| BLAKE2b-256 |
636c98304044d23671f3ca4a907af00231183c8ee7aade621c2f8716ca396d79
|