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.
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
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
There are 4 Loss functions in the framework.
- Categorical Crossentropy
- Binary Crossentropy
- Mean Squared Error
- Mean Absolute Error
- Accuracy Regressional
- Accuracy Categorical
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.
-
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
- Unix/macOS:
-
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)
If you have any issues please feel free to open an issue.
- 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.