coregeist is a Python library to convert deep neural network models into c source code.
Project description
bitgeist
bitgeist is a Python library to convert deep neural network models into c source code.
Installation
Use the package manager pip to install bitgeist.
pip install coregeist
Usage
import coregeist as cg
# transform a pytorch model to c code
print(cg.transform(model))
Example:
...
import coregeist as cg
...
class MnistModel(nn.Module):
def __init__(self):
super(MnistModel, self).__init__()
inputs = 28 * 28
hidden = 120
output = 10
self.l1 = cg.Linear(inputs, hidden, downsample=downsample)
self.action = nn.PReLU(hidden)
self.l2 = cg.Linear(hidden, output, downsample=downsample)
def forward(self, x):
out = self.l1(x)
out = self.action(out)
out = self.l2(out)
return out
model = MnistModel().to(device)
# train the model
...
print(cg.transform(model)) # print or write to file ...
...
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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 coregeist-0.1.5.tar.gz.
File metadata
- Download URL: coregeist-0.1.5.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.9.7 Darwin/21.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba08c357c7a46e2c19ce6521b9477803f188c393ce088ce513c6ed546494959f
|
|
| MD5 |
4dc222907dfd16aa417f6c5f839dfacb
|
|
| BLAKE2b-256 |
691e77c1d581f979a931f54ac64958a4954a3698ae11e30007ff099640670925
|
File details
Details for the file coregeist-0.1.5-py3-none-any.whl.
File metadata
- Download URL: coregeist-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.9.7 Darwin/21.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
086ae7441d959cd2ac97200390ed584e135ee622687fec613c74bfd96e785431
|
|
| MD5 |
33a0e0771610ca93693909b107fb671f
|
|
| BLAKE2b-256 |
4f80734f478bdc6da4eb1442d4b475d79fe94d07809a8bdba21f45deb586008e
|