Skip to main content

This is the small library for deep learning.

Project description

This is Grand Lantern neural network library рџЏ®

The main purpose of this library is to understand - what is happening under the hood of popular deep learning frameworks. Also, it can be used to build your own ideas - no special knowledge for thst you need!

This library is written only using numpy (maybe cupy in future), you can see every calculation in neural network!

How to install в›ЏпёЏ

Put just this command to terminal

pip install grand_lantern

Get started рџљЂ

1. Import library

import grandlantern as gl

2. Define Data Iterator

from grandlantern.dataiterators import DatasetIterator

batch_size = 100
my_dataset_iterator = DatasetIterator(dataset=gl.TableDataset(), batch_size=batch_size)

3. Choose optimizer

from grandlantern.optimizers import SGD

my_optimizer = SGD(learning_rate=0.01)

4. Build model

from grandlantern import model
from grandlantern.metrics import CrossEntropy, Accuracy

NN = model(n_epochs=100,
           dataset_iterator=my_dataset_iterator,
           loss_function=CrossEntropy(),
           metric_function=Accuracy(),
           optimizer=my_optimizer)

5. Add layers

from grandlantern.layers import LinearLayer
from grandlantern.layers.Activation import Sigmoid, ReLU, SoftMax

NN.add_layer(LinearLayer(n_neurons=100, activation=Sigmoid(), biased=True))
NN.add_layer(LinearLayer(n_neurons=50, activation=ReLU(), biased=True))
NN.add_layer(LinearLayer(n_neurons=10, activation=SoftMax(), biased=True))

6. Train model

NN.fit(X_train, y_train.reshape(-1, 1), X_test, y_test.reshape(-1, 1))

7. Use model

y_pred = NN.predict(X_test)

What is supported now вњ…

Layers

  • Linear Layer
  • Image Convolutional Layer (Conv2DLayer)
  • Batch Normalization Layer (BatchNormLayer)
  • RNN Layer (RNNLayer)

Optimizers

  • SGD
  • NAG
  • Adagrad
  • Adam

What will be done рџ“ќ

New Layers

  • LSTM, GRU layers
  • Transformers

GPU Accelaration using cupy

Some more optimizers

Regularization

  • L1, L2 regularization
  • Dropout
  • Pooling

Preprocessing modules

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

grandlantern-0.0.8.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grandlantern-0.0.8-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file grandlantern-0.0.8.tar.gz.

File metadata

  • Download URL: grandlantern-0.0.8.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for grandlantern-0.0.8.tar.gz
Algorithm Hash digest
SHA256 91afe0788f39f7dda35858f80ab9e1be149a3e1ed1b122316d531b9d9283047c
MD5 572631ec0802a4db5a79788fc09f9ec0
BLAKE2b-256 ae73ee4a76e35b8cc6bc913b99210761b59a73e1f9b7cd3c1b558c6887f83a9d

See more details on using hashes here.

File details

Details for the file grandlantern-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: grandlantern-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for grandlantern-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 873377325394ad854477d576bcc467971c89fbd73a00b99380d9af44d95c39cc
MD5 3509699f6ef0a6930d3ee9d9983d0141
BLAKE2b-256 622fb83bb26f2b91f29980b5375d994118b4e28d75036cdc36a1e06b9b842f0e

See more details on using hashes here.

Supported by

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