-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Advanced Usage | ||
============== | ||
|
||
The following sections outline advanced usage in :mod:`torchensemble`. | ||
|
||
Faster inference using functorch | ||
-------------------------------- | ||
|
||
:mod:`functorch` has been integrated into Pytorch since the release of version 1.13, which is JAX-like composable function transforms for PyTorch. To enable faster inference of ensembles in :mod:`torchensemble`, you could use :meth:`vectorize` method of the ensemble to convert it into a stateless version (fmodel), and stacked parameters and buffers. | ||
|
||
The stateless model, parameters, along with buffers could be used to reduce the inference time using :meth:`vmap` in :mod:`functorch`. More details are available at `functorch documentation <https://pytorch.org/functorch/stable/notebooks/ensembling.html>`__. The code snippet below demonstrates how to pass :meth:`ensemble.vectorize` results into :meth:`functorch.vmap`. | ||
|
||
.. code:: python | ||
from torchensemble import VotingClassifier # voting is a classic ensemble strategy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8cc576c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear xuyxu, please tell me: how must one define the ground truth variables (labels) and features in the train/test loaders ?
I did not understand where are labels and features.
With due respect,
Alex Binun