TorchSharp icon indicating copy to clipboard operation
TorchSharp copied to clipboard

Suggestions for more examples

Open NiklasGustafsson opened this issue 4 years ago • 7 comments

I received these suggestions from @GeorgeS2019 via email:

https://github.com/Apress/pytorch-recipes

https://github.com/Apress/pytorch-recipes/blob/master/Torch_AI_7.ipynb

Has a few NLP examples to “complete” your torchsharp examples • 7.1 Word Embedding • 7.2 Continuous bag of words (CBOW) • 7.3 LSTM Model

NiklasGustafsson avatar May 25 '21 19:05 NiklasGustafsson

an example for loading and running torchscript models for mobile android/ios inference would be great

imjwang avatar Jun 15 '21 13:06 imjwang

@imjwang, do you mean a model that has been built using Pytorch and TorchScript, loaded with .NET, or do you mean training and producing the model using .NET, then exporting to native code via TorchScript?

NiklasGustafsson avatar Jun 15 '21 14:06 NiklasGustafsson

the former, a pretrained model that has already been exported to .ts or .pt

imjwang avatar Jun 15 '21 14:06 imjwang

PyTorch for Deep Learning: Creating and Deploying Deep Learning Applications

import spacy
import torchtext
import pandas as pd
import torch.nn as nn
import torch.optim as optim
from torchtext.legacy import data
import IPython.display as display
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import random
import torch
import torchaudio
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from pathlib import Path
from PIL import Image
from torch.utils.data import Dataset
from torchvision import models, transforms
import torch
import torch.nn as nn
import torch.utils.data
import torchvision
from functools import partial
from torch import optim
from torch.utils.tensorboard import SummaryWriter
from torchvision import datasets, transforms

GeorgeS2019 avatar Jun 15 '21 18:06 GeorgeS2019

I have Pytorch experience, but am completely new to Xamarin, C#, and .NET eg. I'm still trying to figure out how to correctly import Torchsharp to a Xamarin cross-platform mobile project after installing the nuget package. So any basic Xamarin and C# examples like what @GeorgeS2019 suggested would help tremendously.

Thank you in advance.

imjwang avatar Jun 15 '21 21:06 imjwang

WIP Oct 2023 Update

https://github.com/rognarspb/TorchClassifier https://github.com/MIAIONE/TorchSharpTest https://github.com/mlnethub/SegFormer-Segnext-torchsharp/ https://github.com/lijianxin520/torchsharp_baselib https://github.com/rognarspb/TorchClassifier/ https://github.com/ds5678/TorchCategorizationDemo

GeorgeS2019 avatar Oct 08 '23 09:10 GeorgeS2019