Skip to content
/ Dimag Public

Dimag, Nepali for the brain is an object-oriented neural network framework developed by me using python3.

License

Notifications You must be signed in to change notification settings

B0s0/Dimag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Dimag?

Dimag, Nepali for the brain is an object-oriented neural network framework developed by me in python3. It is the framework that I built during the neural network from scratch course. I used libraries such as NumPy, nnfs, and OpenCV to build this.

Activation functions

There are 4 activation functions that can be imported from and be used, they are:

  • ReLU Activation function
  • Softmax Activation function
  • Sigmoid Activation function
  • Linear Activation function

Optimizers

I have built 4 optimizers in the framework so that any can be used as per requirements. They are:

  • SGD Optimizer
  • AdaGrad Optimizer
  • Adam Optimizer
  • RMSprop Optimizer

Loss functions

There are 4 Loss functions in the framework.

  • Categorical Crossentropy
  • Binary Crossentropy
  • Mean Squared Error
  • Mean Absolute Error

Accuracy functions

  • Accuracy Regressional
  • Accuracy Categorical

Misc

Moreover, there are functions that are required and some additional functions for convenience.

  • Layer_Dense
  • Layer_Dropout
  • Layer_Input
  • Model: for training, saving, and loading the model
  • create_mnist_data: for convenience while using mnist data

Other functions such as common loss, load_mnist_data serve as requirements for other main functions.

Usage

  • Clone this repository.
    git clone https://github.com/B0s0/Dimag.git
    cd Dimag

  • Install the required libraries.

    • Unix/macOS:
      python3 -m pip install -r requirements.txt
    • Windows:
      py -m pip install -r requirements.txt
  • Add the cloned folder to path at the beginning of your .py file.
    sys.path.append('<path to cloned repo>')

  • Import necessary objects as per your requirement in your python file. For eg:
    from dimag import Layer_Dense, Activation_ReLU, Activation_Softmax, np, Activation_Softmax, Model, Loss_CategoricalCrossentropy, Optimizer_Adam, Accuracy_Categorical

    Alternatively, you can import everything for convenience
    from dimag import *

  • You can then use the framework to design your model and train it. (Please read example.md for more details on this)

Contributing

If you have any issues please feel free to open an issue.

For contributing

  • Fork this repository.
  • Clone your forked repository to your machine.
  • Make necessary changes and commit to your local repository.
  • Push those changes to the forked repository.
  • Open a pull request requesting those changes in this repository.

If you have any confusions on how to contribute, please check out this awesome article from Dataschool.

Thanks for using Dimag. Don't forget to star this repository. 🥰