Coder Social home page Coder Social logo

mohhizzani / numnn.jl Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 839 KB

Neural Networks deals with hardware implementations and simulation in mind

License: MIT License

Julia 100.00%
machine-learning neural-network arithmetic number-format number-representation posit rns julia-language julia hardware-acceleration

numnn.jl's Introduction

GitHub main.yml Status Travis CI building Status Stable Documentation Dev Documentation
.github/workflows/main.yml Build Status

NumNN.jl

This package provides high-level Neural Network APIs deals with different number representations like Posit, Logarithmic Data Representations, Residual Number System (RNS), and -for sure- the conventional IEEE formats.

Since, the implementation and development process for testing novel number systems on different Deep Learning applications using the current available DP frameworks in easily feasible. An urgent need for an unconventional library that provides both the easiness and complexity of simulating and testing and evaluate new number systems before the hardware design complex process— was resurfaced.

Why Julia?

Julia provides in an unconventional way the ability to simulate new number systems and deploy this simulation to be used as high-level primitive type. Multiple Dispatch provides a unique ability to write a general code then specify the implementation based on the type.

Examples of Multiple Dispatch

julia> aInt = 1; #with Integer type

julia> bInt = 2; #with Integer type

julia> cInt = 1 + 2; #which is a shortcut for cInt = +(1,2)

julia> aFloat = 1.0; #with Float64 type

julia> bFloat = 2.0; #with Flot64 type

julia> aInt + bFloat #will use the method +(::Int64, ::Float64)
3.0

Now let's do something more interesting with Posit (continue on the previous example)

julia> using SoftPosit

julia> aP = Posit16(1)
Posit16(0x4000)

julia> bP = Posit16(2)
Posit16(0x5000)

julia> aInt + aP #Note how the result is in Posit16 type
Posit16(0x5000)

The output was of type Posit16 because in Julia you can define a Promote Rule which mean when the output can be in either type(s) of the input, promote the output to be of the specified type. Which can be defined as follows:

Base.promote_rule(::Type{Int64}, ::Type{Posit16}) = Posit16

This means that the output of an operation on both Int64 and Posit16 should be converted to Posit16.

Install

To install in Julia

julia> ] add NumNN

To Use

julia> using NumNN

numnn.jl's People

Contributors

github-actions[bot] avatar mohhizzani avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.