%global _empty_manifest_terminate_build 0 Name: python-torchility Version: 0.7.2 Release: 1 Summary: please add a summary manually as the author left a blank one License: MIT URL: https://github.com/hitlic/torchility Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f0/2d/6c3c41c629a165bab5142d301d3c8cd1896acd47107627cb5b09072fc17b/torchility-0.7.2.tar.gz BuildArch: noarch Requires: python3-torch Requires: python3-pytorch-lightning Requires: python3-torchmetrics Requires: python3-matplotlib Requires: python3-pyyaml Requires: python3-tensorboardX %description # torchility A tool for training pytorch deep learning model more simply which is based on Pytorch-lightning. ## Install - `pip install torchility` ### Dependency - pytorch>=2.0 - pytorch-lightning>=2.0,<2.1 - torchmetrics>=0.11,<0.12 - matplotlib>=3.3 - pyyaml>=5.4 - tensorboardX>=2.6 ## Usage - MNIST ```python from torchility import Trainer import torch from torch import nn from torch.nn import functional as F from torchvision.datasets import MNIST from torchvision import transforms from torch.utils.data import DataLoader, random_split import warnings warnings.simplefilter("ignore") # ignore annoying warnings # datasets data_dir = './datasets' transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]) mnist_full = MNIST(data_dir, train=True, transform=transform, download=True) train_ds, val_ds = random_split(mnist_full, [55000, 5000]) test_ds = MNIST(data_dir, train=False, transform=transform, download=True) # dataloaders train_dl = DataLoader(train_ds, batch_size=32) val_dl = DataLoader(val_ds, batch_size=32) test_dl = DataLoader(test_ds, batch_size=32) # pytorch model channels, width, height = (1, 28, 28) model = nn.Sequential( nn.Flatten(), nn.Linear(channels * width * height, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 10) ) # optimizer opt = torch.optim.Adam(model.parameters(), lr=2e-4) # trainer trainer = Trainer(model, F.cross_entropy, opt, epochs=2) # train and validate trainer.fit(train_dl, val_dl) # test trainer.test(test_dl) ``` - See the `examples` for more examples %package -n python3-torchility Summary: please add a summary manually as the author left a blank one Provides: python-torchility BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-torchility # torchility A tool for training pytorch deep learning model more simply which is based on Pytorch-lightning. ## Install - `pip install torchility` ### Dependency - pytorch>=2.0 - pytorch-lightning>=2.0,<2.1 - torchmetrics>=0.11,<0.12 - matplotlib>=3.3 - pyyaml>=5.4 - tensorboardX>=2.6 ## Usage - MNIST ```python from torchility import Trainer import torch from torch import nn from torch.nn import functional as F from torchvision.datasets import MNIST from torchvision import transforms from torch.utils.data import DataLoader, random_split import warnings warnings.simplefilter("ignore") # ignore annoying warnings # datasets data_dir = './datasets' transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]) mnist_full = MNIST(data_dir, train=True, transform=transform, download=True) train_ds, val_ds = random_split(mnist_full, [55000, 5000]) test_ds = MNIST(data_dir, train=False, transform=transform, download=True) # dataloaders train_dl = DataLoader(train_ds, batch_size=32) val_dl = DataLoader(val_ds, batch_size=32) test_dl = DataLoader(test_ds, batch_size=32) # pytorch model channels, width, height = (1, 28, 28) model = nn.Sequential( nn.Flatten(), nn.Linear(channels * width * height, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 10) ) # optimizer opt = torch.optim.Adam(model.parameters(), lr=2e-4) # trainer trainer = Trainer(model, F.cross_entropy, opt, epochs=2) # train and validate trainer.fit(train_dl, val_dl) # test trainer.test(test_dl) ``` - See the `examples` for more examples %package help Summary: Development documents and examples for torchility Provides: python3-torchility-doc %description help # torchility A tool for training pytorch deep learning model more simply which is based on Pytorch-lightning. ## Install - `pip install torchility` ### Dependency - pytorch>=2.0 - pytorch-lightning>=2.0,<2.1 - torchmetrics>=0.11,<0.12 - matplotlib>=3.3 - pyyaml>=5.4 - tensorboardX>=2.6 ## Usage - MNIST ```python from torchility import Trainer import torch from torch import nn from torch.nn import functional as F from torchvision.datasets import MNIST from torchvision import transforms from torch.utils.data import DataLoader, random_split import warnings warnings.simplefilter("ignore") # ignore annoying warnings # datasets data_dir = './datasets' transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,))]) mnist_full = MNIST(data_dir, train=True, transform=transform, download=True) train_ds, val_ds = random_split(mnist_full, [55000, 5000]) test_ds = MNIST(data_dir, train=False, transform=transform, download=True) # dataloaders train_dl = DataLoader(train_ds, batch_size=32) val_dl = DataLoader(val_ds, batch_size=32) test_dl = DataLoader(test_ds, batch_size=32) # pytorch model channels, width, height = (1, 28, 28) model = nn.Sequential( nn.Flatten(), nn.Linear(channels * width * height, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 64), nn.ReLU(), nn.Dropout(0.1), nn.Linear(64, 10) ) # optimizer opt = torch.optim.Adam(model.parameters(), lr=2e-4) # trainer trainer = Trainer(model, F.cross_entropy, opt, epochs=2) # train and validate trainer.fit(train_dl, val_dl) # test trainer.test(test_dl) ``` - See the `examples` for more examples %prep %autosetup -n torchility-0.7.2 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-torchility -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue May 30 2023 Python_Bot - 0.7.2-1 - Package Spec generated