Skip to main content

codecov

nekograd

Fast & Flexible (just like a catgirl) deep learning framework.

All frameworks require vast manuscripts of code to be written in order to create the simplest trainable model configuration. We propose nekograd as a convenient way of creating such pipelines with the least amount of code needed to be written.

Installation

pip install nekograd

or

git clone https://github.com/arseniybelkov/nekograd.git
cd nekograd && pip install -e .

Example

CoreModel inherits everything from LightningModule
and just implements it basic methods so you don't have to.

import torch
import torch.nn as nn
import pytorch_lightning as pl
from nekograd.model import CoreModel
from nekograd.model.policy import Multiply
from sklearn.metrics import accuracy_score


# Simplest use case, which covers many DL tasks.
# You just define architecture, loss function, metrics,
# optimizer and lr_scheduler.

architecture: nn.Module = nn.Sequential(nn.Flatten(), nn.Linear(28 * 28, 10))
criterion: Callable = nn.CrossEntropyLoss()
metrics: Dict[str, Callable] = {"accuracy": accuracy_score}

optimizer = torch.optim.Adam(architecture.parameters())
lr_scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer,
                                                 Multiply({10: 0.1}))

model = CoreModel(architecture, criterion, metrics,
                  optimizer=optimizer, lr_scheduler=lr_scheduler)

device = "gpu" if torch.cuda.is_available() else "cpu"

trainer = pl.Trainer(max_epochs=20, accelerator=device)

trainer.fit(model, datamodule=...)
trainer.test(model, datamodule=...)

Metadata

Release files for nekograd 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nekograd 0.2.0
File Size Uploaded
nekograd-0.2.0.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nekograd 0.2.0
File Interpreter ABI Platform
nekograd-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / nekograd-0.2.0.tar.gz

Download URL nekograd-0.2.0.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f401b40da542cd0889364b18c73edc479e916cb6fd73ae376ec1a27a54110286
BLAKE2b-256 checksum
How to use checksums
372ad2f6bce1a0068fa2a9f531b82ec0e64484675c7ce4e0ea2b55a341aecc40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / nekograd-0.2.0-py3-none-any.whl

Download URL nekograd-0.2.0-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7aa8c2b39e74edbfe140f2625b2307fb7a6efc8f8ccfab8276de89901eb2f569
BLAKE2b-256 checksum
How to use checksums
c7a8c16386564b3e4df4fbc2661bd3b2f73b19b30aea25875d34c0186a2d2848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page