Skip to content

Commit

Permalink
replace sidae encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-santiago committed Sep 6, 2023
1 parent 903e1c7 commit 9f90389
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoencoders/conf/model/sidae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: SiDAE
nn:
_target_: autoencoders.models.sidae.SiDAE
encoder:
_target_: autoencoders.modules.CNNEncoder
_target_: autoencoders.modules.CNNEncoderProjection
channels_in: 1
base_channels: 32
latent_dim: ${model.nn.dim}
Expand Down
99 changes: 99 additions & 0 deletions outputs/SiDAE/train/2023-09-05/22-01-36/.hydra/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
data:
batch_size: 256
n_workers: 10
name: mnist
train:
_target_: torch.utils.data.DataLoader
dataset:
_target_: autoencoders.data.SiDAEDataset
dataset:
_target_: autoencoders.data.get_mnist_dataset
train: true
num_ops: 1
loc: 0
scale: 1
factor: 1.0
batch_size: ${data.batch_size}
shuffle: true
num_workers: ${data.n_workers}
valid:
_target_: torch.utils.data.DataLoader
dataset:
_target_: autoencoders.data.SiDAEDataset
dataset:
_target_: autoencoders.data.get_mnist_dataset
train: false
num_ops: 1
loc: 0
scale: 1
factor: 1.0
batch_size: ${data.batch_size}
shuffle: false
num_workers: ${data.n_workers}
model:
optimizer:
_target_: torch.optim.Adam
_partial_: true
lr: 0.001
betas:
- 0.9
- 0.999
weight_decay: 0
scheduler:
_target_: torch.optim.lr_scheduler.ReduceLROnPlateau
_partial_: true
mode: min
factor: 0.1
patience: 10
name: SiDAE
nn:
_target_: autoencoders.models.sidae.SiDAE
encoder:
_target_: autoencoders.modules.CNNEncoderProjection
channels_in: 1
base_channels: 32
latent_dim: ${model.nn.dim}
decoder:
_target_: autoencoders.modules.CNNDecoder
channels_in: 1
base_channels: 32
latent_dim: ${model.nn.dim}
dim: 512
pred_dim: 512
trainer:
_target_: pytorch_lightning.Trainer
max_epochs: 100
accelerator: mps
devices: 1
logger:
_target_: pytorch_lightning.loggers.WandbLogger
project: autoencoders
name: null
id: null
group: null
job_type: null
save_dir: ${hydra:runtime.output_dir}
log_model: true
tags: ${tags}
callbacks:
model_summary:
_target_: pytorch_lightning.callbacks.RichModelSummary
progress_bar:
_target_: pytorch_lightning.callbacks.RichProgressBar
refresh_rate: 5
leave: true
early_stopping:
_target_: pytorch_lightning.callbacks.EarlyStopping
monitor: train-loss
min_delta: 0.001
patience: 5
check_on_train_epoch_end: true
model_checkpoint:
_target_: pytorch_lightning.callbacks.ModelCheckpoint
dirpath: ${hydra:runtime.output_dir}/checkpoints
monitor: train-loss
save_top_k: 1
save_on_train_epoch_end: true
tags:
- ${data.name}
- ${model.name}
175 changes: 175 additions & 0 deletions outputs/SiDAE/train/2023-09-05/22-01-36/.hydra/hydra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
hydra:
run:
dir: outputs/${model.name}/${hydra.job.name}/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweep:
dir: outputs/${model.name}/${hydra.job.name}/multirun
subdir: ${hydra.job.override_dirname}/${now:%Y-%m-%d}/${now:%H-%M-%S}
launcher:
_target_: hydra_plugins.hydra_joblib_launcher.joblib_launcher.JoblibLauncher
n_jobs: -1
backend: null
prefer: processes
require: null
verbose: 0
timeout: null
pre_dispatch: 2*n_jobs
batch_size: auto
temp_folder: null
max_nbytes: null
mmap_mode: r
sweeper:
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
max_batch_size: null
params: null
help:
app_name: ${hydra.job.name}
header: '${hydra.help.app_name} is powered by Hydra.
'
footer: 'Powered by Hydra (https://hydra.cc)
Use --hydra-help to view Hydra specific help
'
template: '${hydra.help.header}
== Configuration groups ==
Compose your configuration from those groups (group=option)
$APP_CONFIG_GROUPS
== Config ==
Override anything in the config (foo.bar=value)
$CONFIG
${hydra.help.footer}
'
hydra_help:
template: 'Hydra (${hydra.runtime.version})
See https://hydra.cc for more info.
== Flags ==
$FLAGS_HELP
== Configuration groups ==
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
to command line)
$HYDRA_CONFIG_GROUPS
Use ''--cfg hydra'' to Show the Hydra config.
'
hydra_help: ???
hydra_logging:
version: 1
formatters:
simple:
format: '[%(asctime)s][HYDRA] %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: simple
stream: ext://sys.stdout
root:
level: INFO
handlers:
- console
loggers:
logging_example:
level: DEBUG
disable_existing_loggers: false
job_logging:
version: 1
formatters:
simple:
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
handlers:
console:
class: logging.StreamHandler
formatter: simple
stream: ext://sys.stdout
file:
class: logging.FileHandler
formatter: simple
filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log
root:
level: INFO
handlers:
- console
- file
disable_existing_loggers: false
env: {}
mode: RUN
searchpath: []
callbacks: {}
output_subdir: .hydra
overrides:
hydra:
- hydra.mode=RUN
task:
- data=sidae
- model=sidae
- callbacks=siam
job:
name: train
chdir: null
override_dirname: callbacks=siam,data=sidae,model=sidae
id: ???
num: ???
config_name: config
env_set: {}
env_copy: []
config:
override_dirname:
kv_sep: '='
item_sep: ','
exclude_keys: []
runtime:
version: 1.3.2
version_base: '1.3'
cwd: /Users/chrissantiago/Dropbox/GitHub/autoencoders
config_sources:
- path: hydra.conf
schema: pkg
provider: hydra
- path: /Users/chrissantiago/Dropbox/GitHub/autoencoders/autoencoders/conf
schema: file
provider: main
- path: ''
schema: structured
provider: schema
output_dir: /Users/chrissantiago/Dropbox/GitHub/autoencoders/outputs/SiDAE/train/2023-09-05/22-01-36
choices:
experiment: null
callbacks: siam
trainer: default
model: sidae
scheduler@model.scheduler: plateau
optimizer@model.optimizer: adam
data: sidae
hydra/env: default
hydra/callbacks: null
hydra/job_logging: default
hydra/hydra_logging: default
hydra/hydra_help: default
hydra/help: default
hydra/sweeper: basic
hydra/launcher: joblib
hydra/output: default
verbose: false
3 changes: 3 additions & 0 deletions outputs/SiDAE/train/2023-09-05/22-01-36/.hydra/overrides.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- data=sidae
- model=sidae
- callbacks=siam
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
? /Users/chrissantiago/Dropbox/GitHub/autoencoders/outputs/SiDAE/train/2023-09-05/22-01-36/checkpoints/epoch=76-step=18095.ckpt
: -0.967785120010376
8 changes: 8 additions & 0 deletions outputs/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,13 @@
"auc": 0.9814
},
"ckpt": "/Users/chrissantiago/Dropbox/GitHub/autoencoders/outputs/SiDAE/train/2023-09-05/21-54-15/checkpoints/epoch=13-step=3290.ckpt"
},
{
"model": "SiDAE",
"metrics": {
"acc": 0.9862,
"auc": 0.9924
},
"ckpt": "/Users/chrissantiago/Dropbox/GitHub/autoencoders/outputs/SiDAE/train/2023-09-05/22-01-36/checkpoints/epoch=76-step=18095.ckpt"
}
]

0 comments on commit 9f90389

Please sign in to comment.