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
import learn2learn as l2l | |
mnist = torchvision.datasets.MNIST(root="/tmp/mnist", train=True) | |
mnist = l2l.data.MetaDataset(mnist) | |
task_generator = l2l.data.TaskGenerator(mnist, | |
ways=3, | |
classes=[0, 1, 4, 6, 8, 9], | |
tasks=10) | |
model = Net() |
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
dataset: | |
name: imagenet | |
path: /datasets/imagenet |
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
$ python my_app.py | |
dataset: | |
name: imagenet | |
path: /datasets/imagenet |
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
defaults: | |
- dataset: cifar10 |
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
$ python my_app.py | |
dataset: | |
name: cifar10 | |
path: /datasets/cifar10 | |
optimizer: | |
beta: 0.01 | |
lr: 0.1 | |
type: adam |
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
import os | |
from omegaconf import DictConfig | |
import hydra | |
@hydra.main() | |
def my_app(_cfg: DictConfig) -> None: | |
print(f"Current working directory : {os.getcwd()}") | |
print(f"Orig working directory : {hydra.utils.get_original_cwd()}") | |
print(f"to_absolute_path('foo') : {hydra.utils.to_absolute_path('foo')}") | |
print(f"to_absolute_path('/foo') : {hydra.utils.to_absolute_path('/foo')}") |
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
$ python examples/tutorial/8_working_directory/original_cwd.py | |
Current working directory : /home/omry/dev/hydra/outputs/2020-01-16/15-42-50 | |
Orig working directory : /home/omry/dev/hydra | |
to_absolute_path('foo') : /home/omry/dev/hydra/foo | |
to_absolute_path('/foo') : /foo |
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
$ python my_app.py --multirun dataset=imagenet,cifar10 optimizer=adam,nesterov | |
[HYDRA] Sweep output dir : multirun/2020-01-16/14-01-10 | |
[HYDRA] Launching 4 jobs locally | |
[HYDRA] #0 : dataset=imagenet optimizer=adam | |
dataset: | |
name: imagenet | |
path: /datasets/imagenet | |
optimizer: | |
beta: 0.01 | |
lr: 0.1 |
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
VERSION = "20200220" #@param ["20200220","nightly", "xrt==1.15.0"] | |
!curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py | |
!python pytorch-xla-env-setup.py --version $VERSION |
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
VERSION = "20200220" #@param ["20200220","nightly", "xrt==1.15.0"] | |
!curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py | |
!python pytorch-xla-env-setup.py --version $VERSION |
OlderNewer