Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using .NET interactive notebooks #35

Open
GeorgeS2019 opened this issue Jul 6, 2022 · 10 comments
Open

Consider using .NET interactive notebooks #35

GeorgeS2019 opened this issue Jul 6, 2022 · 10 comments

Comments

@GeorgeS2019
Copy link

GeorgeS2019 commented Jul 6, 2022

There are many console apps used to demo numpy.net

As an alternative, consider porting numpy tutorials or examples provided by numpy textbook to demo the almost close to 1-to-1 coverage of numpy functions using numpy.net and distribute that to new users using .NET interactive notebook instead of jupyter notebook.

@GeorgeS2019
Copy link
Author

public void print(object obj)
{
    if (obj == null)
    {
        Console.WriteLine("<null>");
        return;
    }
    if (obj is Array)
    {
        foreach (var o in (Array)obj)
        {
            Console.Write(o.ToString() + ",");
        }
        Console.WriteLine("");
    }
    else
    {
        Console.WriteLine(obj.ToString());
    }
}
public void print(string label, object obj)
{
    Console.WriteLine(label + obj.ToString());
}
public void print<T>(string label, T[] array)
{
    Console.WriteLine(label + ArrayToString(array));
}

public string ArrayToString<T>(T[] array)
{
    StringBuilder sb = new StringBuilder();

    sb.Append("[");

    foreach (T t in array)
    {
        sb.Append(t.ToString());
        sb.Append(",");
    }

    sb.Append("]");

    return sb.ToString();
}

@KevinBaselinesw
Copy link
Collaborator

Hi George,

It is not clear what you are asking. Do you think there is a bug in the print function? Is there a bug in the np.arange function?

@GeorgeS2019
Copy link
Author

@KevinBaselinesw
I would like to encourage more users to start sharing Numpy Notebooks using NumpyDotNet

This issue is to track the experience of using NumpyDotNet and how the output may or may not be similar to that generated from python in Notebooks.

@KevinBaselinesw
Copy link
Collaborator

let me know what I can do to help.

FYI, I am not familiar with Numpy Notebooks so you may have provide some additional information to me.

@GeorgeS2019
Copy link
Author

@KevinBaselinesw
The first question most users would like to know what is your numpy's coverage and how it is related to the existing numpy version

I found

arraysetos.cs
.. versionadded:: 1.13.0

Does this mean not all codes are of similar version??

This need to be tracked in a e.g. release

In TorchSharp, it is communicated through discussion.

@GeorgeS2019
Copy link
Author

For notebook, I am searching for e.g. numpy 101 that provides notebook that show use cases of different topics of numpy. Ideally, as a community, we use NumpyDotNet to complete such notebook in c#

@KevinBaselinesw
Copy link
Collaborator

I don't have a perfect match between numpydotnet and a specific version of numpy. The brief history is that I inherited an abandoned attempt to create a .net version of Numpy that was hybrid of C# and C. Most of the python code was removed. That code probably only implemented 25% of the numpy API. I took that code, ported the C code to C#, eliminated all of the interop code, debugged it and then ported the rest missing numpy API to C#. Most of the porting that I did was from version .17 if I remember correctly. The good news is that there really is not much difference between the various versions of Numpy. That API doesn't really change much from version to version.

@GeorgeS2019
Copy link
Author

Great, now we have the background, we need. We appreciate how much work you have done. Thanks.

@KevinBaselinesw
Copy link
Collaborator

For notebook, I am searching for e.g. numpy 101 that provides notebook that show use cases of different topics of numpy. Ideally, as a community, we use NumpyDotNet to complete such notebook in c#

Are you trying to recreate a dynamic site like this for python numpy?

https://www.w3resource.com/python-exercises/numpy/python-numpy-exercise-1.php

@GeorgeS2019
Copy link
Author

GeorgeS2019 commented Aug 28, 2022

@KevinBaselinesw
The priority is to persuade the .NET communities to focus on ONE effort on NumPy.

The good news is that there really is not much difference between the various versions of Numpy. That API doesn't really change much from version to version.

The communities need some way to know how GREAT the coverage and hopefully, someone will step forwards to update the communities with each release of the python version on the .NET minor changes needed to keep up with the latest python NumPy release.

Right now, these TWO criteria exist for TorchSharp BUT are absent in many other efforts. Although TorchSharp still has A LOT to cover, the communities have started to be more and more feeling confident of the TorchSharp effort.

ALL THESE may look trivial, BUT it is for the GREATER GOOD!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants