Skip to main content

This is a machine learning--more specifically deep learning--library from my independent study on deep learning. This library is both a result of my learning and a tool for AI development.

Project description

Deeplearning Package

Overview

This package is designed to be similar to the PyTorch system of a building block system, providing functions that can be mixed, matched, and customized for any given model. It implements core deep learning concepts including automatic differentiation, sequential modeling, and various layer types.

Modules

This project has six main modules:

  • autogradient.py
  • sequence.py
  • optimizer.py
  • neural_net.py
  • cnn_layers.py
  • rnn_layers.py

All of which are automatically part of the initial import of the package.

Detailed Module Descriptions

autogradient.py

This module forms the core of the automatic differentiation system. It introduces the Values class, which tracks computational history to compute gradients.

  • Values Class: Encapsulates numerical values (vals) and their corresponding gradients (grad).
  • Broadcasting Support: Includes a sophisticated _broadcast_grad static method that automatically handles gradient shape adjustments during backpropagation when operations involve broadcasted NumPy arrays (e.g., adding a bias vector to a matrix).
  • Operations: Supports a wide array of operations including arithmetic (+, -, *, /, @, **), activation functions (relu, tanh, softmax), and tensor manipulations (reshape, transpose, pad, sum, mean, max, and slicing/indexing).

rnn_layers.py (New)

This module provides implementations for Recurrent Neural Networks, suitable for sequential data processing.

  • RNNCell: The fundamental building block for recurrent layers, performing the basic hidden state update: $h_t = \text{activation}(W_{ih} x_t + b_{ih} + W_{hh} h_{t-1} + b_{hh})$.
  • RNN Layer: A high-level wrapper that processes entire sequences, maintaining hidden states across time steps and supporting both many-to-many and many-to-one architectures.

cnn_layers.py

Implements fundamental building blocks for Convolutional Neural Networks.

  • Convo2D: Supports 'valid' and 'same' padding, custom strides, and automated gradient computation for kernels.
  • Pooling: Includes MaxPooling and AvgPooling for spatial down-sampling.

neural_net.py

Defines high-level components for model construction.

  • Layer & Dense: Fully connected layers with customizable activations.
  • Dropout: Regularization technique to prevent overfitting by randomly zeroing activations during training.
  • Model: The central class for training. It handles the training loop, batching, and integration with loss functions (cross_entropy_loss, mse_loss) and penalty functions (l1_reg, l2_reg).

optimizer.py

Implements parameter update algorithms: Optim_SGD, Optim_SGD_Momentum, Optim_AdaGrad, Optim_RMSPropclass, and Optim_Adam.

sequence.py

Provides the Sequence container to stack layers and manage parameter retrieval across the model.

Dependencies

The package relies heavily on numpy for numerical operations and gradient tracking.

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

rb_deeplearning_lib-0.4.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

rb_deeplearning_lib-0.4.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file rb_deeplearning_lib-0.4.1.tar.gz.

File metadata

  • Download URL: rb_deeplearning_lib-0.4.1.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for rb_deeplearning_lib-0.4.1.tar.gz
Algorithm Hash digest
SHA256 af99b316f55c7aa355641a5ae2d65de2944e09ad0ef9e8bd6a53620dd7764969
MD5 0a789b9804b5d3cb69120c1f2f7ede97
BLAKE2b-256 44f1b1ae4c4a2ff24107fa0983f8d5f8a80c9daccdde1616beb625389707fe1d

See more details on using hashes here.

File details

Details for the file rb_deeplearning_lib-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rb_deeplearning_lib-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4046ab962960715950d64f2b09e43f5ece6eb61bbd30095be92d3ed51c8b086
MD5 fe155ef0563f25ae65c384592e1574f9
BLAKE2b-256 b998f4cee96759c911617e1565b7cd3dde2e1a233bd16ca90f1cc2202639324b

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