Coder Social home page Coder Social logo

nnsharp's Introduction

logo

Build status

license

A lightweight package for running pre-trained neural networks. For the detailed documentation see the NNSharp documentation.

Philosophy

This library was created in order to run pre-trained neural networks. Training is the most time consuming part of a deep learning framework. Probably C# is not the best for training neural networks. There are a lot of very good solution can be found like Tensorflow, CNTK, Theano, PyTorch, Sonnet ans so on. Most of them suit the Python programming language and mainly support Linux.

Therefore this library aims for using the weights and structure created with the above softwares and just run it in C# on Windows.

Installation

The package is available as a NuGet package from nuget.org. The current NuGet package was built on Windows8.1, Visual Studio 2015 and .Net Framework4.5.2.

Getting started

It is very easy to use the library. The master branch contains a python script named KerasModeltoJSON.py. It takes the created and compiled Keras model and the output file name as arguments. The json file can be created as follows:

import KerasModeltoJSON as js
wrt = js.JSONwriter(model, fname)
wrt.save()

Then in the C# program:

// Read the previously created json.
var reader = new ReaderKerasModel(filePath); 
SequentialModel model = reader.GetSequentialExecutor();

// Then create the data to run the executer on.
// batch: should be set in the Keras model.
Data2D input = new Data2D(height, width, channel, batch);

// Calculate the network's output.
IData output = model.ExecuteNetwork(input);

For the detailed documentation see the NNSharp documentation.

Plans and contributions

The roadmap of the development can be seen on the following picture:

roadmap

The first stage is almost finished. The C++ API is planned to be similar like the Keras API in Python but with some further extensions (concrete architectures, file readers from different library outputs, wrapper for threading etc.)

Bug: Please create an issue with the label bug. Recommending features: Just create an issue with the label question.

For the current tasks see the issues with the label enhancement. If you want to contribute to the development write a letter to the following address: adam.8.budai at gmail dot com.

Summary

This library aims for connecting the models trained in Python with Tensorflow, Theano, Pytorch, Sonnet with C#. It is able to run the models but training has no priority in this project.

Licence

This project runs under the MIT licence. You can use it in any Open Source project.

nnsharp's People

Contributors

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