Helper methods and convenience wrappers #452
Replies: 4 comments 6 replies
-
I think this is very interesting stuff. I think it belongs in its own repository, at least until it stabilizes. Working on datasets and dataset iteration is another big gaping hole right now, so if you have any interest in helping with that, it would be great. What's in the Examples in terms of data sets is just a toy. |
Beta Was this translation helpful? Give feedback.
-
@mfagerlund I do not speak for Microsoft, We appreciate your passion and enthusiasm. TorchSharp at this stage needs people like yourself to contribute to make others able to use and learn TorchSharp faster. One guy who shared at the recent hackathon that it took him 2 weeks of hard work to learn TorchSharp and after that it is productive. Please keep posting your ideas at discussion. |
Beta Was this translation helpful? Give feedback.
-
torchvision and torchtext both come with 'datasets' modules, which are super-useful for getting started. They also come with a common set of iteration constructs, etc. One of the challenges here is that some data sets are small enough to fit in memory, while others do not. Some fit in CPU memory, but not in GPU. That means that specialized iteration constructs need to take that into account and sometimes read every mini-batch from disk, sometimes cache it in CPU memory, sometimes it can stay resident in GPU memory. That requires a little bit of thought and design work. All while taking randomization and sampling into account... |
Beta Was this translation helpful? Give feedback.
-
@mfagerlund If you have time, please put some thinking into how to bring models saved in PyTorch to TorchSharp. There in an ongoing discussion. If with luck you have any idea to share, please start another discussion topic. I believe the .NET community needs feedback how to shuffle models trained in PyTorch to TorchSharp and ML.NET (direct or indirectly through integrated TorchSharp). Some ideas, see the link above, is to keep everything to ONNX. We are very curious what you think of that, when you have time, after a couple of beers :-) |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on as set of helper methods and convenience wrappers, stuff to cut down on boilerplate code. I'm talking about stuff like building and training networks. Helper methods to convert c# data (float[,], float[,,]) to tensors. Managing samples with features and labels. Providing a way to shuffle and split a large block of samples for training.
If that's something what would be interesting to the community, let me know!
Here's the classic Irish Mushroom Classification problem solved using my wrappers. And TorchSharp, of course.
![image](https://user-images.githubusercontent.com/13098745/142446181-f7500207-88cc-491f-a4f2-189558db6c1a.png)
Beta Was this translation helpful? Give feedback.
All reactions