Coder Social home page Coder Social logo

ainshamsflow's Introduction

AinShamsFlow

4th CSE Neural Networks Project.

asf_logo

Contents:

Project Description:

AinShamsFlow (asf) is a Deep Learning Framework built by our Team from Ain Shams University during December 2020 - January 2021.

The Design and Interface is inspired heavily from Keras and TensorFlow.

However, we only implement everything from scratch using only simple libraries such as numpy and matplotlib.

Project Structure:

The Design of all parts can be seen in the following UML Diagram.

UML Diagram of the Project

This is how the Design Structure should work in our Framework.

Desgin Structure

You can read more details on our documentation.

Install:

You can install the latest available version as follows:

$ pip install ainshamsflow

Usage:

you start using this project by importing the package as follows:

>>> import ainshamsflow as asf

then you can start creating a model:

>>> model = asf.models.Sequential([
...     asf.layers.Dense(300, activation="relu"),
...     asf.layers.Dense(100, activation="relu"),
...     asf.layers.Dense( 10, activation="softmax")
... ], input_shape=(784,), name="my_model")
>>> model.print_summary()

then compile and train the model:

>>> model.compile(
... 	optimizer=asf.optimizers.SGD(lr=0.01),
... 	loss='sparsecategoricalcrossentropy',
...     metrics=['accuracy']
... )
>>> history = model.fit(X_train, y_train, epochs=100)

finally you can evaluate, predict and show training statistics:

>>> history.show()
>>> model.evaluate(X_valid, y_valid)
>>> y_pred = model.predict(X_test)

A more elaborate example usage can be found in main.py or check out this demo notebook.

Open In Colab

Team Members:

Todo:

Framework Design:

  • A Data Module to read and process datasets.

    • Dataset

      • __init__()
      • __bool__()
      • __len__()
      • __iter__()
      • __next__()
      • apply()
      • numpy()
      • batch()
      • cardinality()
      • concatenate()
      • copy()
      • enumerate()
      • filter()
      • map()
      • range()
      • shuffle()
      • skip()
      • split()
      • take()
      • unbatch()
      • add_data()
      • add_targets()
      • normalize()
    • ImageDataGenerator

      • __init__()
      • flow_from_directory()
  • A NN Module to design different architectures.

    • Activation Functions

      • Linear
      • Sigmoid
      • Hard Sigmoid
      • Tanh
      • Hard Tanh
      • ReLU
      • LeakyReLU
      • ELU
      • SELU
      • Softmax
      • Softplus
      • Softsign
      • Swish
    • Layers

      • DNN Layers:

        • Dense
        • BatchNorm
        • Dropout
      • CNN Layers 1D: (optional)

        • Conv
        • Pool (Avg and Max)
        • GlobalPool (Avg and Max)
        • Upsample
      • CNN Layers 2D:

        • Conv
        • Pool (Avg and Max)
        • FastConv
        • FastPool (Avg and Max)
        • GlobalPool (Avg and Max)
        • Upsample
      • CNN Layers 3D: (optional)

        • Conv
        • Pool (Avg and Max)
        • GlobalPool (Avg and Max)
        • Upsample
      • Other Extra Functionality:

        • Flatten
        • Activation
        • Reshape
    • Initializers

      • Constant
      • Uniform
      • Normal
      • Identity
    • Losses

      • MSE (Mean Squared Error)
      • MAE (Mean Absolute Error)
      • MAPE (Mean Absolute Percentage Error)
      • BinaryCrossentropy
      • CategoricalCrossentropy
      • SparseCategoricalCrossentropy
      • HuberLoss
      • LogLossLinearActivation
      • LogLossSigmoidActivation
      • PerceptronCriterionLoss
      • SvmHingeLoss
    • Evaluation Metrics

      • Accuracy
      • TP (True Positives)
      • TN (True Negatives)
      • FP (False Positives)
      • FN (False Negatives)
      • Precision
      • Recall
      • F1Score
    • Regularizers

      • L1
      • L2
      • L1_L2
    • Optimization Modules for training

      • SGD
      • Momentum
      • AdaGrad
      • RMSProp
      • AdaDelta
      • Adam
    • A Visualization Modules to track the training and testing processes

      • History Class for showing training statistics
      • verbose parameter in training
      • live plotting of training statistics
    • A utils module for reading and saving models

    • Adding CUDA support

    • Publish to PyPI

    • Creating a Documentation for the Project

Example Usage:

This part can be found in the demo notebook mentioned above.

  • Download and Split a dataset (MNIST or CIFAR-10) to training, validation and testing
  • Construct an Architecture (LeNet or AlexNet) and make sure all of its components are provided in your framework.
  • Train and test the model until a good accuracy is reached (Evaluation Metrics will need to be implemented in the framework also)
  • Save the model into a compressed format

ainshamsflow's People

Contributors

pierrenabil avatar ziadtarekk avatar michael-m-mike avatar john-bahaa avatar girgismicheal avatar hazzum avatar ibrahimshoukry512 avatar atf01 avatar

Stargazers

Mohammed Siddiq avatar Thakur Rithk Singh avatar mohamedt-ea avatar Kotoz avatar  avatar Mohamed Rashad avatar  avatar

Watchers

Ahmed Mohammed avatar  avatar

ainshamsflow's Issues

Some Code is defined twice.

We can delete one copy of the written code.

remove from the first:
import numpy as np
till the next similar:
import numpy as np

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.