-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an explanation of experiments and other things
- Loading branch information
Showing
12 changed files
with
163 additions
and
8 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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
defaults: | ||
# Specify here the name of the entry in the `dm` config group you want to extend. | ||
- celeba | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
defaults: | ||
# Specify here the name of the entry in the `dm` config group you want to extend. | ||
- celeba | ||
|
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,12 @@ | ||
# @package _global_ | ||
--- | ||
defaults: | ||
- override /dm: cmnist | ||
- override /model: cnn | ||
|
||
dm: | ||
num_colors: 10 | ||
val_prop: 0.2 | ||
|
||
model: | ||
kernel_size: 5 |
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 @@ | ||
# @package _global_ | ||
--- | ||
defaults: | ||
- override /model: fcn | ||
|
||
model: | ||
num_hidden: 2 | ||
hidden_dim: 10 | ||
norm: LN | ||
input_norm: true | ||
activation: SELU | ||
|
||
opt: | ||
lr: 0.001 | ||
weight_decay: 0.001 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
defaults: | ||
- fcn | ||
|
||
|
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
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
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
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,24 @@ | ||
"""Optimisation and training code.""" | ||
|
||
from collections.abc import Iterator | ||
from dataclasses import dataclass | ||
from typing import Any | ||
|
||
from torch.nn import Parameter | ||
from torch.optim import Optimizer | ||
|
||
__all__ = ["OptimisationCfg"] | ||
|
||
|
||
@dataclass | ||
class OptimisationCfg: | ||
"""Config class for the optimisation.""" | ||
|
||
lr: float = 5.0e-5 | ||
weight_decay: float = 0.0 | ||
optimizer_cls: str = "torch.optim.AdamW" | ||
optimizer_kwargs: dict[str, Any] | None = None | ||
|
||
def build(self, params: Iterator[tuple[str, Parameter]]) -> Optimizer: | ||
# Instantiate the optimizer for the given parameters. | ||
raise NotImplementedError() |
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