{"id":13716989,"url":"https://github.com/inferno-pytorch/inferno","last_synced_at":"2025-10-21T20:47:10.099Z","repository":{"id":46084455,"uuid":"93671170","full_name":"inferno-pytorch/inferno","owner":"inferno-pytorch","description":"A utility library around PyTorch","archived":true,"fork":false,"pushed_at":"2022-12-26T20:28:08.000Z","size":40552,"stargazers_count":244,"open_issues_count":19,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-05T11:18:49.452Z","etag":null,"topics":["deep-learning","neural-networks","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inferno-pytorch.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-07T19:19:48.000Z","updated_at":"2024-06-10T06:54:43.000Z","dependencies_parsed_at":"2023-01-31T01:15:15.453Z","dependency_job_id":null,"html_url":"https://github.com/inferno-pytorch/inferno","commit_stats":null,"previous_names":["nasimrahaman/inferno"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferno-pytorch%2Finferno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferno-pytorch%2Finferno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferno-pytorch%2Finferno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inferno-pytorch%2Finferno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inferno-pytorch","download_url":"https://codeload.github.com/inferno-pytorch/inferno/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252486928,"owners_count":21755835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","neural-networks","pytorch"],"created_at":"2024-08-03T00:01:16.346Z","updated_at":"2025-10-21T20:47:04.776Z","avatar_url":"https://github.com/inferno-pytorch.png","language":"Python","funding_links":[],"categories":["Pytorch \u0026 related libraries｜Pytorch \u0026 相关库","Python"],"sub_categories":["Other libraries｜其他库:"],"readme":"\n=======\nInferno\n=======\n\n.. image:: https://anaconda.org/conda-forge/inferno/badges/version.svg   \n        :target: https://anaconda.org/conda-forge/inferno\n\n.. image:: https://travis-ci.org/inferno-pytorch/inferno.svg?branch=master\n        :target: https://travis-ci.org/inferno-pytorch/inferno\n\n..\n  TODO new docs shield goes here, see https://github.com/inferno-pytorch/inferno/issues/139\n  .. image:: https://readthedocs.org/projects/inferno-pytorch/badge/?version=latest\n          :target: http://inferno-pytorch.readthedocs.io/en/latest/?badge=latest\n          :alt: Documentation Status\n\n\n.. image:: http://svgshare.com/i/2j7.svg\n\n\n\n\n\nInferno is a little library providing utilities and convenience functions/classes around \n`PyTorch \u003chttps://github.com/pytorch/pytorch\u003e`_. \nIt's a work-in-progress, but the releases from v0.4 on should be fairly stable! \n\n\n\n* Free software: Apache Software License 2.0\n* Documentation: http://inferno-pytorch.readthedocs.io (Work in Progress).\n\n\nFeatures\n--------\n\nCurrent features include: \n  *   a basic \n      `Trainer class \u003chttps://github.com/nasimrahaman/inferno/tree/master/docs#preparing-the-trainer\u003e`_ \n      to encapsulate the training boilerplate (iteration/epoch loops, validation and checkpoint creation),\n  *   a `graph API \u003chttps://github.com/nasimrahaman/inferno/blob/master/inferno/extensions/containers/graph.py\u003e`_ for building models with complex architectures, powered by `networkx \u003chttps://github.com/networkx/networkx\u003e`_. \n  *   `easy data-parallelism \u003chttps://github.com/nasimrahaman/inferno/tree/master/docs#using-gpus\u003e`_ over multiple GPUs, \n  *   `a submodule \u003chttps://github.com/nasimrahaman/inferno/blob/master/inferno/extensions/initializers\u003e`_ for `torch.nn.Module`-level parameter initialization,\n  *   `a submodule \u003chttps://github.com/nasimrahaman/inferno/blob/master/inferno/io/transform\u003e`_ for data preprocessing / transforms,\n  *   `support \u003chttps://github.com/nasimrahaman/inferno/tree/master/docs#using-tensorboard\u003e`_ for `Tensorboard \u003chttps://www.tensorflow.org/get_started/summaries_and_tensorboard\u003e`_ (best with atleast `tensorflow-cpu \u003chttps://github.com/tensorflow/tensorflow\u003e`_ installed)\n  *   `a callback API \u003chttps://github.com/nasimrahaman/inferno/tree/master/docs#setting-up-callbacks\u003e`_ to enable flexible interaction with the trainer,\n  *   `various utility layers \u003chttps://github.com/nasimrahaman/inferno/tree/master/inferno/extensions/layers\u003e`_ with more underway,\n  *   `a submodule \u003chttps://github.com/nasimrahaman/inferno/blob/master/inferno/io/volumetric\u003e`_ for volumetric datasets, and more!\n\n  \n\n\n\n.. code:: python\n\n  import torch.nn as nn\n  from inferno.io.box.cifar import get_cifar10_loaders\n  from inferno.trainers.basic import Trainer\n  from inferno.trainers.callbacks.logging.tensorboard import TensorboardLogger\n  from inferno.extensions.layers.convolutional import ConvELU2D\n  from inferno.extensions.layers.reshape import Flatten\n\n  # Fill these in:\n  LOG_DIRECTORY = '...'\n  SAVE_DIRECTORY = '...'\n  DATASET_DIRECTORY = '...'\n  DOWNLOAD_CIFAR = True\n  USE_CUDA = True\n\n  # Build torch model\n  model = nn.Sequential(\n      ConvELU2D(in_channels=3, out_channels=256, kernel_size=3),\n      nn.MaxPool2d(kernel_size=2, stride=2),\n      ConvELU2D(in_channels=256, out_channels=256, kernel_size=3),\n      nn.MaxPool2d(kernel_size=2, stride=2),\n      ConvELU2D(in_channels=256, out_channels=256, kernel_size=3),\n      nn.MaxPool2d(kernel_size=2, stride=2),\n      Flatten(),\n      nn.Linear(in_features=(256 * 4 * 4), out_features=10),\n      nn.LogSoftmax(dim=1)\n  )\n\n  # Load loaders\n  train_loader, validate_loader = get_cifar10_loaders(DATASET_DIRECTORY,\n                                                      download=DOWNLOAD_CIFAR)\n\n  # Build trainer\n  trainer = Trainer(model) \\\n    .build_criterion('NLLLoss') \\\n    .build_metric('CategoricalError') \\\n    .build_optimizer('Adam') \\\n    .validate_every((2, 'epochs')) \\\n    .save_every((5, 'epochs')) \\\n    .save_to_directory(SAVE_DIRECTORY) \\\n    .set_max_num_epochs(10) \\\n    .build_logger(TensorboardLogger(log_scalars_every=(1, 'iteration'),\n                                    log_images_every='never'),\n                  log_directory=LOG_DIRECTORY)\n\n  # Bind loaders\n  trainer \\\n      .bind_loader('train', train_loader) \\\n      .bind_loader('validate', validate_loader)\n\n  if USE_CUDA:\n    trainer.cuda()\n\n  # Go!\n  trainer.fit()\n\n\n\n\nTo visualize the training progress, navigate to `LOG_DIRECTORY` and fire up tensorboard with \n\n.. code:: bash\n\n  $ tensorboard --logdir=${PWD} --port=6007\n\n\nand navigate to `localhost:6007` with your browser.\n\n\n\nInstallation\n------------------------\n\nConda packages for python \u003e= 3.6 for all distributions are availaible on conda-forge:\n\n.. code:: bash\n\n  $ conda install -c pytorch -c conda-forge inferno\n\n\n\nFuture Features: \n------------------------\nPlanned features include: \n  *   a class to encapsulate Hogwild! training over multiple GPUs, \n  *   minimal shape inference with a dry-run,\n  *   proper packaging and documentation,\n  *   cutting-edge fresh-off-the-press implementations of what the future has in store. :)\n\n\n\nCredits\n---------\nAll contributors are listed here_. \n.. _here: https://inferno-pytorch.github.io/inferno/html/authors.html\n\nThis package was partially generated with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template + lots of work by Thorsten. \n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finferno-pytorch%2Finferno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finferno-pytorch%2Finferno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finferno-pytorch%2Finferno/lists"}