
Machine Learning for .NET - melenaos
https://github.com/dotnet/machinelearning/blob/master/README.md
======
Rapzid
For those who are not aware, there is
[https://github.com/migueldeicaza/TensorFlowSharp](https://github.com/migueldeicaza/TensorFlowSharp)
for your arbitrary TF in DotNet needs. Last I played with it, it even work
well in F#. Which, let's be honest here, is the dream right? Right?!

~~~
Melchizedek
TensorFlowSharp has bindings to the C API of TensorFlow, but no
implementations of the Python stuff that you really need for training, such as
optimizers.

I _really_ want to use F# for training deep learning models, but at this point
it doesn't seem feasible, at least not without a lot of hassle compared to
using Python.

~~~
Rapzid
Hmm, didn't realize that; I only ever really verified it worked and worked
with F# haha. In the scheme of things the optimizers are rather small bits
that could be encapsulated quickly..

Poking around it looks like Accord.Net is interested in getting CNN support in
via TensorFlowSharp: [https://github.com/accord-
net/framework/issues/92](https://github.com/accord-net/framework/issues/92) .
Then there is ConvNetSharp.

I'm sure a fun project for someone would also be to implement all this in a
pure F# library. It supposedly has some pretty good GPU libs.

------
zamalek
It doesn't really come across as a framework, it's more of an API. A framework
would allow you to invent new approaches (such as ODE networks), where-as this
API supports the models that ship with it and nothing else. That's fine, but
it's not in the same space as Tensorflow etc.

~~~
ankitasthana
ML.NET is a machine learning framework which is aimed at providing the E2E
workflow for infusing ML into .NET apps across pre-processing, feature
engineering, modeling, evaluation, and model consumption.

The base framework comes with a variety of transforms, trainers, utility apis
for loading varies forms of data (e.g. csv's, tsv's) to build custom machine
learning models trained with your own data.

Using the API you can build a variety of models for scenarios like Sentiment
analysis (classification), forecasting, recommendation and also leverage pre-
built Tensorflow models for scenarios like image classification.

The samples repo provided shows you a variety of scenarios with ML.NET.

[https://github.com/dotnet/machinelearning-
samples](https://github.com/dotnet/machinelearning-samples)

@zamalek, would love to learn how we can improve the API to make this stand
out :).

~~~
zamalek
"Framework" (contained in the original title of this post) implies that you
can "build your own thing" with the library. CNTK and Tensorflow are
frameworks.

ML.NET only has what's in the box, it's turn-key. You guys have an explicit
ResNet18 assembly, as one example. While this is incredibly useful, it is not
appropriate to call such a library a _framework._

A possible improvement would be:

ML.NET is a machine learning _API_ which is aimed at providing _turn-key_
models for infusing ML...

If you wanted it to classify as a framework, you'd have to provide something
like Tensorflow does: a way to develop new and novel models.

That's just my opinion, but a few people seem to agree.

~~~
nickspag
You can absolutely train your own models. Your comment is patently false and a
fraction of the time it took to write it should have been spent reading that
API you have so inaptly described. I encourage you to delete it.

~~~
zamalek
You can use it to train the models that they have built. You can't make new
models. I've done quite a bit of research into ML.NET because the nomenclature
lead me to believe that it can fill the role of Tensorflow.

------
manigandham
They've been releasing versions monthly, here are the last few release notes:

v0.7 =
[https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcin...](https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcing-
ml-net-0-7-machine-learning-net/)

v0.6 =
[https://blogs.msdn.microsoft.com/dotnet/2018/10/08/announcin...](https://blogs.msdn.microsoft.com/dotnet/2018/10/08/announcing-
ml-net-0-6-machine-learning-net/)

v0.5 =
[https://blogs.msdn.microsoft.com/dotnet/2018/09/12/announcin...](https://blogs.msdn.microsoft.com/dotnet/2018/09/12/announcing-
ml-net-0-5/)

------
brianberns
Does this compete with the Microsoft Cognitive Toolkit (CNTK)? Seems odd that
they would have two separate ML frameworks.

[https://www.microsoft.com/en-us/cognitive-
toolkit/](https://www.microsoft.com/en-us/cognitive-toolkit/)

~~~
ankitasthana
The way to think about ML.NET is really a higher level framework which comes
built in with traditional ML trainers, transforms etc. and through its
extensibility allows .NET developers to also use other leading frameworks for
deep learning e.g. TensorFlow and standards e.g. ONNX models using one uniform
set of APIs.

You can learn more about ML.NET here:
[https://dotnet.microsoft.com/apps/machinelearning-ai/ml-
dotn...](https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet)

------
rajadigopula
Also worthy of mentioning -
[https://dotnet.github.io/infer/](https://dotnet.github.io/infer/) . Infer.Net
for Bayesian ML.

------
lwansbrough
Anyone know if ML.NET will be capable of _online_ anomaly detection?

~~~
ankitasthana
Here is an example of anomaly detection with ML.NET its not online learning
based however.

[https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcin...](https://blogs.msdn.microsoft.com/dotnet/2018/11/08/announcing-
ml-net-0-7-machine-learning-net/#enabled-anomaly-detection-scenarios-and-
detecting-unusual-events)

------
InGodsName
Why .NET isn't used for data sciences?

Does it have numpy alternative?

~~~
nickspag
I started ML work in python coming from a .NET background. To echo one of the
other comments here- I believe one main reason is due to the iterative nature
of data science. You have to sort of re-build completely every time you make a
change in .NET. There isn't much of a notebook concept in .NET- a running
engine you can query with additional commands/cells/etc, which is beneficial.
As well, real-world data feels easier to work with in a more forgiving
environment (non-static typing, etc) like Python. However ML.NET is a cool
endeavor and as the .NET data prep libraries get more mature we may find some
more production benefits from the very typing/compiling system that, while
making it difficult to iterate in, provide more stability in the wild.

~~~
tluyben2
A proper repl seems the first step to start building such
interactive/iterative tooling; F# has one so maybe that is a better start than
C# for this?

C#.NET Core suffers (as far as I know) from this;

[https://stackoverflow.com/questions/47394231/csharpscript-
us...](https://stackoverflow.com/questions/47394231/csharpscript-uses-
incompatible-internal-type-representations-at-every-external-c)

I think Mono has a solution, but as far as I know .NET Core basically is
unusable for scripting because of this for C# which makes the kind of scenario
you want basically impossible from the get go.

It is a bit weird not more attention is given to it given so many people ache
for an interactive C# environment, especially for this purpose, but also for
faster iteration with Xamarin on iOS/Android etc (all of my colleagues would
save a lot of time on development with this for Xamarin mobile dev
especially).

If that has been fixed, there is still the lack of libraries but that and the
rest of what is needed is at least not basically impossible to solve by mere
mortals.

~~~
pjmlp
Visual Studio has a C# REPL sice version 2015.

Then there are Xamarin Workbooks, like Swift playgrounds but for .NET.

~~~
tluyben2
That's not the same thing though; to be able to actually REPL a complete app
or stick in an interpreter where you need it. I tried workbooks and it's more
a toy (like Swift playgrounds by the way). It helps for sure, but when we are
working on bigger existing apps, we want to plug in REPLs in particular places
and iterate. Or generally iterate; both do not fit with the VS REPL or
Workbooks.

~~~
pjmlp
In that regard nothing matches commercial Common Lisp environments or
Smalltalk.

~~~
tluyben2
I agree with you, but having the Mono interpreter (which does not have the
same issues) fully work for mobile (Xamarin Android/iOS) and desktop (it is
with --interpreter) and web (it is with Blazor) would make life easier for
this kind of mainstream development.

