Git Product home page Git Product logo

a-deep-learning-library-implementation's Introduction

Custom MLP Implementation for MNIST Classification

This repository contains the implementation of a Multi-Layer Perceptron (MLP) classifier for the MNIST dataset using a custom tensor library. This project is designed to provide hands-on experience with the inner workings of neural networks, including forward propagation, backpropagation, and gradient descent.

Project Structure

  • gergen.py: Contains the custom tensor library Gergen class and related operations.
  • the2_test.py: A script for testing various functionalities implemented in gergen.py.
  • train.py: The training script to train the MLP model using the custom tensor library.
  • mnist_classification_torch.py: An implementation of the MLP classifier using PyTorch for comparison.

Objective

The main objective of this project is to extend the capabilities of the CerGen tensor library by integrating functionalities crucial for training MLPs. This includes implementing linear layers, activation functions, loss functions, and the backpropagation algorithm.

Files Overview

gergen.py

This file contains the implementation of the custom tensor class Gergen and the base class Operation. It includes various tensor operations required for forward and backward passes in the neural network.

the2_test.py

This script tests the functionalities implemented in gergen.py to ensure correctness. It includes tests for tensor operations, linear layers, and other essential components.

train.py

The main training script for the MLP model. It includes the following components:

  • Layer Class: Represents a linear layer in the MLP.
  • MLP Class: Represents the MLP model with one hidden layer.
  • Training Function: Implements the training loop, including forward pass, loss computation, backward pass, and parameter updates.

mnist_classification_torch.py

This file provides an implementation of the MLP model using PyTorch for comparison. It ensures that the custom implementation achieves similar performance to a well-established deep learning framework.

Usage

You can directly use the .ipynb file, or see the outputs without running it. If you want to use .py files, you need to change main functions accordingly, assuming files are in the same directory.

a-deep-learning-library-implementation's People

Contributors

kkkaan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.