A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch

Overview

Torchmeta

PyPI Build Status Documentation

A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch. Torchmeta contains popular meta-learning benchmarks, fully compatible with both torchvision and PyTorch's DataLoader.

Features

  • A unified interface for both few-shot classification and regression problems, to allow easy benchmarking on multiple problems and reproducibility.
  • Helper functions for some popular problems, with default arguments from the literature.
  • An thin extension of PyTorch's Module, called MetaModule, that simplifies the creation of certain meta-learning models (e.g. gradient based meta-learning methods). See the MAML example for an example using MetaModule.

Datasets available

Installation

You can install Torchmeta either using Python's package manager pip, or from source. To avoid any conflict with your existing Python setup, it is suggested to work in a virtual environment with virtualenv. To install virtualenv:

pip install --upgrade virtualenv
virtualenv venv
source venv/bin/activate

Requirements

  • Python 3.6 or above
  • PyTorch 1.4 or above
  • Torchvision 0.5 or above

Using pip

This is the recommended way to install Torchmeta:

pip install torchmeta

From source

You can also install Torchmeta from source. This is recommended if you want to contribute to Torchmeta.

git clone https://github.com/tristandeleu/pytorch-meta.git
cd pytorch-meta
python setup.py install

Example

Minimal example

This minimal example below shows how to create a dataloader for the 5-shot 5-way Omniglot dataset with Torchmeta. The dataloader loads a batch of randomly generated tasks, and all the samples are concatenated into a single tensor. For more examples, check the examples folder.

from torchmeta.datasets.helpers import omniglot
from torchmeta.utils.data import BatchMetaDataLoader

dataset = omniglot("data", ways=5, shots=5, test_shots=15, meta_train=True, download=True)
dataloader = BatchMetaDataLoader(dataset, batch_size=16, num_workers=4)

for batch in dataloader:
    train_inputs, train_targets = batch["train"]
    print('Train inputs shape: {0}'.format(train_inputs.shape))    # (16, 25, 1, 28, 28)
    print('Train targets shape: {0}'.format(train_targets.shape))  # (16, 25)

    test_inputs, test_targets = batch["test"]
    print('Test inputs shape: {0}'.format(test_inputs.shape))      # (16, 75, 1, 28, 28)
    print('Test targets shape: {0}'.format(test_targets.shape))    # (16, 75)

Advanced example

Helper functions are only available for some of the datasets available. However, all of them are available through the unified interface provided by Torchmeta. The variable dataset defined above is equivalent to the following

from torchmeta.datasets import Omniglot
from torchmeta.transforms import Categorical, ClassSplitter, Rotation
from torchvision.transforms import Compose, Resize, ToTensor
from torchmeta.utils.data import BatchMetaDataLoader

dataset = Omniglot("data",
                   # Number of ways
                   num_classes_per_task=5,
                   # Resize the images to 28x28 and converts them to PyTorch tensors (from Torchvision)
                   transform=Compose([Resize(28), ToTensor()]),
                   # Transform the labels to integers (e.g. ("Glagolitic/character01", "Sanskrit/character14", ...) to (0, 1, ...))
                   target_transform=Categorical(num_classes=5),
                   # Creates new virtual classes with rotated versions of the images (from Santoro et al., 2016)
                   class_augmentations=[Rotation([90, 180, 270])],
                   meta_train=True,
                   download=True)
dataset = ClassSplitter(dataset, shuffle=True, num_train_per_class=5, num_test_per_class=15)
dataloader = BatchMetaDataLoader(dataset, batch_size=16, num_workers=4)

Note that the dataloader, receiving the dataset, remains the same.

Citation

Tristan Deleu, Tobias Würfl, Mandana Samiei, Joseph Paul Cohen, and Yoshua Bengio. Torchmeta: A Meta-Learning library for PyTorch, 2019 [ArXiv]

If you want to cite Torchmeta, use the following Bibtex entry:

@misc{deleu2019torchmeta,
  title={{Torchmeta: A Meta-Learning library for PyTorch}},
  author={Deleu, Tristan and W\"urfl, Tobias and Samiei, Mandana and Cohen, Joseph Paul and Bengio, Yoshua},
  year={2019},
  url={https://arxiv.org/abs/1909.06576},
  note={Available at: https://github.com/tristandeleu/pytorch-meta}
}
Comments
  • help installing torchmeta (for ppc64le IBM architecture)

    help installing torchmeta (for ppc64le IBM architecture)

    I got the following error:

    ERROR: Could not find a version that satisfies the requirement torch<1.7.0,>=1.4.0 (from torchmeta) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
    ERROR: No matching distribution found for torch<1.7.0,>=1.4.0 (from torchmeta)
    

    unfortunately, the cluster I use has only 1.3.1 and I believe it's due to hardware stuff. They don't use x86 basically.

    what are solutions for me?


    SO: https://stackoverflow.com/questions/64049603/how-does-one-install-torchmeta-for-a-ppc64le-architecture-in-pytorch SO: https://stackoverflow.com/questions/64033543/force-installing-torchvision-0-4-2-when-i-am-forced-to-use-pytorch-1-3-1-due-to ibm issue: https://github.com/IBM/powerai/issues/268

    opened by brando90 23
  • Bug with dataparallel in Pytorch 1.6

    Bug with dataparallel in Pytorch 1.6

    Hi, thanks for providing this cool library! We successfully implement the meta-learning where hypernet generates weights for the hyponet. The code runs successfully on single GPU. When we apply Dataparallel, it prompts:

    File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply output.reraise() File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/_utils.py", line 395, in reraise raise self.exc_type(msg) KeyError: Caught KeyError in replica 0 on device 0. Original Traceback (most recent call last): File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 60, in _worker output = module(*input, **kwargs) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/Work/point_codebase/models/FoldingMLP.py", line 133, in forward hypo_params = self.hyper_neti File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/Work/point_codebase/models/meta_modules_old.py", line 63, in forward params[name] = net(z).reshape(batch_param_shape) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/Work/point_codebase/models/meta_modules_old.py", line 197, in forward output = self.net(coords, params=self.get_subdict(params, "net")) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torchmeta/modules/container.py", line 12, in forward input = module(input, params=self.get_subdict(params, name)) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torchmeta/modules/container.py", line 12, in forward input = module(input, params=self.get_subdict(params, name)) File "/home/zhanbo/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/home/zhanbo/Work/point_codebase/models/meta_modules_old.py", line 78, in forward weight = params["weight"] KeyError: 'weight'

    We have found this error arises from the bug of Pytorch 1.6 (https://github.com/pytorch/pytorch/issues/36035), where ParameterList appears empty in the forward pass. Do you have any workaround solution? Thanks!

    opened by zhangmozhe 16
  • A minimal example with toy data set

    A minimal example with toy data set

    I was trying to use the toy data-sets but when I got errors like train doesn't exist when trying to loop through the batches. Can we have a tiny minimal example to loop through the data for toy data sets?

    My attempt

    from torchmeta.toy import Sinusoid
    #from torchmeta.datasets.helpers import omniglot
    from torchmeta.utils.data import BatchMetaDataLoader
    
    from tqdm import tqdm
    
    num_samples_per_task = 10
    dataset = Sinusoid(num_samples_per_task, num_tasks=10, noise_std=None,
        transform=None, target_transform=None, dataset_transform=None)
    #dataset = omniglot("data", ways=5, shots=5, test_shots=15, meta_train=True, download=True)
    dataloader = BatchMetaDataLoader(dataset, batch_size=5, num_workers=4)
    print(f'len(dataset) = {len(dataset)}')
    print(f'len(dataloader) = {len(dataloader)}')
    for batch in dataloader:
        train_inputs, train_targets = batch["train"]
    

    other weird things was like the tensors being of size 16 but my meta-batch size being of size 5...

    opened by renesax14 12
  • Clarification of term episodic vs meta-set vs meta-batching

    Clarification of term episodic vs meta-set vs meta-batching

    I think I asked this somewhere but can't find it easily and I think it's important.

    When we have a meta-set (a data-set of data-sets with support & query splits) D_meta = {D_i}^N_{i=1} is the index i called an episode or is an episode a (meta) batch (of data-sets) from this meta-set (e.g. of size 16)?

    cross posted: https://stats.stackexchange.com/questions/478255/what-does-the-term-episode-mean-in-meta-learning

    reference:

    • https://github.com/tristandeleu/pytorch-meta/issues/78
    • https://www.quora.com/unanswered/What-does-the-term-episode-mean-in-meta-learning
    • https://www.reddit.com/r/MLQuestions/comments/hve478/what_does_the_term_episode_mean_in_metalearning/?
    • https://discuss.pytorch.org/t/what-does-the-term-episode-mean-in-meta-learning/90051
    • https://stats.stackexchange.com/questions/478255/what-does-the-term-episode-mean-in-meta-learning
    opened by renesax14 9
  • Overlap between train and test sets within task on multiple splits

    Overlap between train and test sets within task on multiple splits

    Hi,

    Thanks for the clean and well-organized code of this repository. I investigated the train/test split within each dataset and explored the ClassSplitter class. I noticed that the training and testing partitions of an individual task can be overlapping with multiple class splits. The random state is initialized once in self.seed() in https://github.com/tristandeleu/pytorch-meta/blob/35f4cc222a3727390f988e9ef7ec78545ac0a0fd/torchmeta/transforms/splitters.py#L17 and then used for each task split in (e.g.) get_indices_task() https://github.com/tristandeleu/pytorch-meta/blob/35f4cc222a3727390f988e9ef7ec78545ac0a0fd/torchmeta/transforms/splitters.py#L176 Since the internal seed of the random state advances, samples from dataset_indices are redrawn at each function call and can overlap within multiple function calls.

    I wrote this test code on the current version

    class DemoTask(Task):
    	def __init__(self):
    	    super(DemoTask, self).__init__(None)
    	    self._inputs = np.arange(10)
    
    	def __len__(self):
    	    return len(self._inputs)
    
    	def __getitem__(self, index):
    	    return self._inputs[index]
    
    splitter = ClassSplitter(shuffle=True, num_train_per_class=5, num_test_per_class=5)
    task = DemoTask()
    
    # split task five times into train and test
    for i in range(5):
    	tasks_split = splitter(task)
    	train_task = tasks_split["train"]
    	test_task = tasks_split["test"]
    
            print("train split: "+str([train_task[i] for i in range(len(train_task))]))
            print("test split:  "+str([test_task[i] for i in range(len(train_task))]))
    

    that returns

    train split: [2, 8, 4, 9, 1]
    test split:  [6, 7, 3, 0, 5]
    
    train split: [3, 5, 1, 2, 9]
    test split:  [8, 0, 6, 7, 4]
    
    train split: [2, 3, 8, 4, 5]
    test split:  [1, 0, 6, 9, 7]
    
    train split: [6, 1, 9, 2, 7]
    test split:  [5, 8, 0, 3, 4]
    
    train split: [5, 2, 7, 4, 1]
    test split:  [0, 6, 8, 9, 3]
    

    Each split nicely separates samples into separate train and test datasets. However, there is an overlap of samples from multiple splits. For instance sample "4" is in train-test-train-test-train.

    This pull request fixes the samples for train/test splits with the random state using the initial seed np.random.RandomState(self.random_state_seed) and then shuffles the separate split indices again with the running self.np_random_seed I also added a pytest with two asserts:

    1. assert len(train_samples.intersection(test_samples)) == 0 checks if there is any overlap within one split (the current version passes this test)
    2. assert len(samples_in_all_test_splits.intersection(samples_in_all_train_splits)) == 0 checks if there is an overlap of samples between different splits (the current version fails this test)

    The print output from above looks like this with this pull request:

    train split: [4, 2, 8, 9, 1]
    test split:  [6, 3, 7, 5, 0]
    
    train split: [8, 9, 1, 2, 4]
    test split:  [0, 7, 3, 5, 6]
    
    train split: [1, 4, 9, 8, 2]
    test split:  [3, 0, 5, 7, 6]
    
    train split: [4, 1, 8, 9, 2]
    test split:  [0, 7, 5, 3, 6]
    
    train split: [2, 1, 4, 8, 9]
    test split:  [5, 3, 0, 7, 6]
    

    Thanks again for this repository. It is a pleasure writing working with it.

    opened by MarcCoru 8
  • Is Torchmeta compatible with Dataparallel?

    Is Torchmeta compatible with Dataparallel?

    Hi, is torchmeta compatible with dataparallel? I have troubles training a MetaModule wrapped by dataparallel. It seems get_subdict has problems with the layer names starting with "module." Thanks for your help!

    opened by smounsav 7
  • Some doubts

    Some doubts

    Hi, I really appreciate your great work ! But i have some doubts about details.

    1. for miniimagenet ,in torchmeta.datasets.helpers. I find you use resize(84), why not using data augument such as randomcrop(84)? In addtion to above issue, In turn, the dafault setting of transform is resize, totensor. Why no Normalize?
    2. we run your code on miniimagenet, I find that gpus take up a lot of memory compared to normal code with same setting, a 1080Ti is not enough. Why? Looking forward to your reply, thank you!
    opened by CSer-Tang-hao 6
  • ModuleList and get_subdict naming

    ModuleList and get_subdict naming

    if I create a ModuleList with this. so for each MetaLinearNorm, it is anonymous.

            self.**layers** = nn.ModuleList(
            [MetaLinearNorm(in_size, out_size, bias=False)
             for (in_size, out_size) in zip(in_sizes, sizes)])
    

    then in forward, suppose I should change to this?

          for linear in self.**layers**:
            x = F.dropout(F.relu(linear(x, params=self.get_subdict(params, '**layers**'))), p=0.5, training=True)
    

    but module list is a list of MetaLinearNorm. will using the same layers fine? it seems not okay?

    opened by raymond00000 5
  • How can I use an optimizer with the extracted parameters?

    How can I use an optimizer with the extracted parameters?

    I would like to use an optimizer with the extracted parameters but I keep getting some unexpected behavior like the parameters are still referring to the parameter list in the original model...

    model = DropoutNet(in_dim, args.h_dim, out_dim).to(args.device)                                                                                                                                                                                                          optimizer = torch.optim.SGD(model.parameters(), lr=1, weight_decay=1e-4)      
    
    params = OrderedDict(model.parameters())
    p_opt = torch.optim.SGD(params.values(), lr=1e-3)
    
    yhat = model(x, params=params)
    loss = criterion(y, yhat)
    
    for p in params.values():
      p.grad.add_(loss)
    
    p_opt.step()
    p_opt.zero_grad()                                                                     
    

    If I do something like this and then print out the parameters, the parameters in the model will be the same as the ones in the params dict. Is there a better way to do this?

    opened by jeffwillette 5
  • misunderstanding of the data size of omniglot

    misunderstanding of the data size of omniglot

    Hi, I noticed the description of the dataset: "The Omniglot dataset [1]. A dataset of 1623 handwritten characters from 50 different alphabets. The meta train/validation/test splits used in [3] are taken from [this repository]. These splits are over 1028/172/423 classes " . However, when I tested dataset = omniglot(data_path, ways=6, shots=10, test_shots=15, meta_train=True, download=True) print(len(dataset)) the result is this huge number: 6689615974037915648, Also, when I use dataloader, the number of total batch seems not equal 1028. If I change argument "ways" to bigger than 10, i get this bug: "OverflowError: cannot fit 'int' into an index-sized integer". Is there any misunderstanding of this dataset here? Thanks for your explanation

    opened by xuesongwang 5
  • Feature suggestion: Add flag to module.get_subdict to return None instead of empty OrderedDict

    Feature suggestion: Add flag to module.get_subdict to return None instead of empty OrderedDict

    i have currently the issue of calling a key that is not existent in a parameter dictionary like this:

    p = self.get_subdict(params, "features")
    

    of course it makes sense as the default behavior to return an empty OrderedDict. But unfortunately when I call forward propagation with p, it is not handled as NoneType and leads to an error:

    features = self.features(
        input, params=p
    )
    

    My work-around procedure looks like this, but is quite ugly:

    p = self.get_subdict(params, "features")
    if p is not None and len(p)==0:
        p = None
    

    instead something along the following, which would simply force None as return instead of an empty OrderedDict, would greatly improve the aesthetics of the code:

    p = self.get_subdict(params, "features", force_None=True)
    
    opened by SebGGruber 4
  • how to download a pytorch version that is compatible with thorchmeta 1.8.0

    how to download a pytorch version that is compatible with thorchmeta 1.8.0

    pip3 install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
    
    DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
    Defaulting to user installation because normal site-packages is not writeable
    Looking in links: https://download.pytorch.org/whl/torch_stable.html
    ERROR: Could not find a version that satisfies the requirement torch==1.9.1+cu111
    ERROR: No matching distribution found for torch==1.9.1+cu111
    
    opened by brando90 3
  • CVE-2007-4559 Patch

    CVE-2007-4559 Patch

    Patching CVE-2007-4559

    Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

    If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

    opened by TrellixVulnTeam 0
  • Download miniimagenet error

    Download miniimagenet error

    I use google drive to download and finish.

    miniimagenet > mini-imagenet.tar.gz

    dataset = miniimagenet(..., meta_train=True, download=True)

    and i got,

    NameError: name 'check_integrity' is not defined

    how should i fix this error. thx.

    opened by C1ndeRainBo0M 2
  • Torchmeta downgrades the Torch and the Torchvision versions

    Torchmeta downgrades the Torch and the Torchvision versions

    Within a conda environment, I installed a conda environment containing these pytorch libraries: conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch However, when I pip install torchmeta, it seems that it downgrades torch from 1.11.0 to 1.9.1 and torchvision from 0.12.0 to 0.10.1. Where I can get a Torchmeta version that is compatible with torch 1.11 and torchvision 0.12.0 ?

      Using cached torch-1.9.1-cp39-cp39-manylinux1_x86_64.whl (831.4 MB)
    Collecting torchvision<0.11.0,>=0.5.0
      Using cached torchvision-0.10.1-cp39-cp39-manylinux1_x86_64.whl (22.1 MB)
    
      Attempting uninstall: torch
        Found existing installation: torch 1.11.0
        Uninstalling torch-1.11.0:
          Successfully uninstalled torch-1.11.0
      Attempting uninstall: torchvision
        Found existing installation: torchvision 0.12.0
        Uninstalling torchvision-0.12.0:
          Successfully uninstalled torchvision-0.12.0```
    opened by MounirB 1
PyTorch extensions for fast R&D prototyping and Kaggle farming

Pytorch-toolbelt A pytorch-toolbelt is a Python library with a set of bells and whistles for PyTorch for fast R&D prototyping and Kaggle farming: What

Eugene Khvedchenya 1.3k Jan 5, 2023
A few Windows specific scripts for PyTorch

It is a repo that contains scripts that makes using PyTorch on Windows easier. Easy Installation Update: Starting from 0.4.0, you can go to the offici

null 408 Dec 15, 2022
GPU-accelerated PyTorch implementation of Zero-shot User Intent Detection via Capsule Neural Networks

GPU-accelerated PyTorch implementation of Zero-shot User Intent Detection via Capsule Neural Networks This repository implements a capsule model Inten

Joel Huang 15 Dec 24, 2022
torch-optimizer -- collection of optimizers for Pytorch

torch-optimizer torch-optimizer -- collection of optimizers for PyTorch compatible with optim module. Simple example import torch_optimizer as optim

Nikolay Novik 2.6k Jan 3, 2023
PyTorch framework A simple and complete framework for PyTorch, providing a variety of data loading and simple task solutions that are easy to extend and migrate

PyTorch framework A simple and complete framework for PyTorch, providing a variety of data loading and simple task solutions that are easy to extend and migrate

Cong Cai 12 Dec 19, 2021
A PyTorch repo for data loading and utilities to be shared by the PyTorch domain libraries.

A PyTorch repo for data loading and utilities to be shared by the PyTorch domain libraries.

null 878 Dec 30, 2022
Tez is a super-simple and lightweight Trainer for PyTorch. It also comes with many utils that you can use to tackle over 90% of deep learning projects in PyTorch.

Tez: a simple pytorch trainer NOTE: Currently, we are not accepting any pull requests! All PRs will be closed. If you want a feature or something does

abhishek thakur 1.1k Jan 4, 2023
null 270 Dec 24, 2022
Unofficial PyTorch implementation of DeepMind's Perceiver IO with PyTorch Lightning scripts for distributed training

Unofficial PyTorch implementation of DeepMind's Perceiver IO with PyTorch Lightning scripts for distributed training

Martin Krasser 251 Dec 25, 2022
The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.

News March 3: v0.9.97 has various bug fixes and improvements: Bug fixes for NTXentLoss Efficiency improvement for AccuracyCalculator, by using torch i

Kevin Musgrave 5k Jan 2, 2023
PyGCL: Graph Contrastive Learning Library for PyTorch

PyGCL is an open-source library for graph contrastive learning (GCL), which features modularized GCL components from published papers, standardized evaluation, and experiment management.

GCL: Graph Contrastive Learning Library for PyTorch 592 Jan 7, 2023
A PyTorch implementation of Learning to learn by gradient descent by gradient descent

Intro PyTorch implementation of Learning to learn by gradient descent by gradient descent. Run python main.py TODO Initial implementation Toy data LST

Ilya Kostrikov 300 Dec 11, 2022
Fast, general, and tested differentiable structured prediction in PyTorch

Torch-Struct: Structured Prediction Library A library of tested, GPU implementations of core structured prediction algorithms for deep learning applic

HNLP 1.1k Jan 7, 2023
A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API

micrograd A tiny Autograd engine (with a bite! :)). Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural

Andrej 3.5k Jan 8, 2023
A simplified framework and utilities for PyTorch

Here is Poutyne. Poutyne is a simplified framework for PyTorch and handles much of the boilerplating code needed to train neural networks. Use Poutyne

GRAAL/GRAIL 534 Dec 17, 2022
A simple way to train and use PyTorch models with multi-GPU, TPU, mixed-precision

?? Accelerate was created for PyTorch users who like to write the training loop of PyTorch models but are reluctant to write and maintain the boilerplate code needed to use multi-GPUs/TPU/fp16.

Hugging Face 3.5k Jan 8, 2023
A very simple and small path tracer written in pytorch meant to be run on the GPU

MentisOculi Pytorch Path Tracer A very simple and small path tracer written in pytorch meant to be run on the GPU Why use pytorch and not some other c

Matthew B. Mirman 222 Dec 1, 2022
Kaldi-compatible feature extraction with PyTorch, supporting CUDA, batch processing, chunk processing, and autograd

Kaldi-compatible feature extraction with PyTorch, supporting CUDA, batch processing, chunk processing, and autograd

Fangjun Kuang 119 Jan 3, 2023
A pure Python implementation of Compact Bilinear Pooling and Count Sketch for PyTorch.

Compact Bilinear Pooling for PyTorch. This repository has a pure Python implementation of Compact Bilinear Pooling and Count Sketch for PyTorch. This

Grégoire Payen de La Garanderie 234 Dec 7, 2022