dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.02k stars 1.88k forks source link

[Proposal] Create Keras Neural Network Like API in C# (Create Survey First) #5372

Closed sps014 closed 2 years ago

sps014 commented 4 years ago

In the Last ML.NET Community Standup, we discussed the possibility of having a Keras Like API in C#. (YouTube Talk Link)

The goal is to have similar native C# API that can also take advantage of GPU and also being independent of Tensorflow Binding for DotNet for better performance scenarios.

Keras is simple and easy to use, Keras API in Python looks like this

network = models.Sequential()
network.add(layers.Dense(784, activation='relu', input_shape=(28 * 28,)))
network.add(layers.Dense(784, activation='relu', input_shape=(28 * 28,)))
network.add(layers.Dense(10, activation='softmax'))
network.compile(optimizer='adam',
                loss='categorical_crossentropy',
                metrics=['accuracy'])

Most of us are aware of the community bindings and libraries like Tensorflow.Net etc to name a few but for high-performance scenarios, these libraries seem to struggle (i guess mainly due to Interop Cost)

In my case, with Unity Engine using MLAgent which also depend on TF(Tensorflow). Now in Unity for vision-based experiments ie. with convolutional NN based problems, Unity struggles a bit because each frame of the game they need to send pixel data to TF, which is performance costly, now if we had a similar good implementation of Neural Network in C#, Unity can also get performance improvements around 2 to 4 times (maybe), at least in iteration times.

I request ML.NET Team to create a survey regarding this, so we can share our challenges and use cases and necessity to have a Keras like API.

Thank You.

mstfbl commented 4 years ago

Hi @sps014 ,

Thank you for your suggestion and for the survey request. I will sync with the greater ML.NET team and get back to you on this.

evo11x commented 4 years ago

good proposal!

sps014 commented 4 years ago

@evo11x thanks

forReason commented 4 years ago

thank you for the suggestion! I'm in

sps014 commented 4 years ago

@mstfbl any update or insight ?

harishsk commented 4 years ago

Hi @sps014 Thank you for creating the proposal.

We have so far taken the approach of providing high level functional APIs (like Image classification). And we continue to hear a mixture of feedback about the continued need for high level APIs and also some requirements like yours for a low level API.

We are continuing to evaluate the feedback and the best course of action. Immediate updates will likely be slow to come, but we are looking at this seriously.

We will post an update as soon as we have one.

david-uk-hash commented 4 years ago

Hi , ML.NET without a Neural Network library is incomplete, it's like backbone of human, i can't figure out why such important feature is neglected. This definitely need to come out of backlog, most priority should be assigned.

briacht commented 3 years ago

Keras.NET by SciSharp was just released: https://github.com/SciSharp/Keras.NET

We are working with the SciSharp team to ensure smooth integration w/ ML.NET

saint4eva commented 3 years ago

Keras.NET by SciSharp was just released: https://github.com/SciSharp/Keras.NET

@briacht, The problem with most of the machine learning libraries by SciSharp is that they are not idiomatic .NET / C#.

They are just mimicking python naming convention, and that is not good for a .NET/ C# developer. They put so much energy trying to attract python developers, than they should have invested making the libraries more .NET/ C# oriented.

sps014 commented 3 years ago

Hii any update ?

david-uk-hash commented 3 years ago

@briacht is there any hope to get it in ml.net roadmap. With dotnet interactive , I greatly miss a performant neural network library.

MaltoChan commented 3 years ago

@briacht @mstfbl we want a concrete roadmap , Please specify clearly whether you are considering Neural Network capabilities in ml.net or not.

briacht commented 3 years ago

Hi everyone! We've finalized our plan for deep learning, including neural network capabilities, in .NET / ML.NET!

Please take a look at this issue and leave your feedback: https://github.com/dotnet/machinelearning/issues/5918

luisquintanilla commented 2 years ago

Thanks everyone for the comments and feedback. The Deep Learning plan has been made available and we'll look to libraries like the SciSharp stack and TorchSharp to enable neural network / deep learning capabilities in the .NET space while making simpler abstractions and scenario-based APIs available in ML.NET. Closing this issue.