-
Notifications
You must be signed in to change notification settings - Fork 1
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
alex404
committed
Oct 12, 2024
1 parent
3bc4ba0
commit 4ae29b9
Showing
6 changed files
with
166 additions
and
24 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
resources/config_templates/user/brain/deep-autoencoder.yaml
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,81 @@ | ||
# Configuration for a retinal classifier neural network | ||
|
||
# Define the input sensor | ||
sensors: | ||
vision: # Vision is a list of 3 elements | ||
- 3 # Number of color channels | ||
- 160 # Height of the input image | ||
- 160 # Width of the input image | ||
|
||
# Define how the various NeuralCircuits are connected to each other | ||
connections: | ||
- ["vision", "retina"] # Input to retina | ||
- ["retina","thalamus"] # Retina to thalamus | ||
- ["thalamus","visual_cortex"] # Thalamus to visual cortex | ||
- ["visual_cortex", "pfc"] # Visual cortex to prefrontal cortex | ||
- ["pfc", "classifier"] # Prefrontal cortex to classifier | ||
- ["pfc", "pfc_decoder"] # pfc to FC decoder | ||
- ["pfc_decoder", "decoder"] # FC decoder to convoluational decoder | ||
|
||
# Define the individual nodes (neural circuits) of the network. Many circuit | ||
# parameters are interpolated from the experiment config. | ||
circuits: | ||
# Retina: initial processing of visual input | ||
retina: | ||
_target_: retinal_rl.models.circuits.convolutional.ConvolutionalEncoder | ||
num_layers: 2 | ||
num_channels: [16,32] # Two layers with 16 and 32 channels | ||
kernel_size: 8 | ||
stride: 2 | ||
act_name: ${activation} | ||
layer_names: ["bipolar", "retinal_ganglion"] # Names inspired by retinal cell types | ||
|
||
# Thalamus: relay and processing station | ||
thalamus: | ||
_target_: retinal_rl.models.circuits.convolutional.ConvolutionalEncoder | ||
num_layers: 1 | ||
num_channels: 64 | ||
kernel_size: 5 | ||
stride: 1 | ||
act_name: ${activation} | ||
layer_names: ["lgn"] # Lateral Geniculate Nucleus | ||
|
||
# Visual Cortex: higher-level visual processing | ||
visual_cortex: | ||
_target_: retinal_rl.models.circuits.convolutional.ConvolutionalEncoder | ||
num_layers: 1 | ||
num_channels: 64 | ||
kernel_size: 8 | ||
stride: 2 | ||
act_name: ${activation} | ||
layer_names: ["v1"] # Primary Visual Cortex | ||
|
||
# Prefrontal Cortex: high-level cognitive processing | ||
pfc: | ||
_target_: retinal_rl.models.circuits.fully_connected.FullyConnectedEncoder | ||
output_shape: | ||
- 128 # Size of the latent representation | ||
hidden_units: | ||
- 64 # Number of hidden units | ||
act_name: ${activation} | ||
|
||
# Prefrontal Cortex: high-level cognitive processing | ||
pfc_decoder: | ||
_target_: retinal_rl.models.circuits.fully_connected.FullyConnectedDecoder | ||
output_shape: "pfc.input_shape" # Size of the latent representation | ||
hidden_units: | ||
- 64 # Number of hidden units | ||
act_name: ${activation} | ||
# Decoder: for reconstructing the input from the latent representation | ||
decoder: | ||
_target_: retinal_rl.models.circuits.convolutional.ConvolutionalDecoder | ||
num_layers: 4 | ||
num_channels: [64,32,16,3] # For a symmetric encoder, this should be the reverse of the num_channels in the CNN layers up to the point of decoding (in this case, the thalamus) | ||
kernel_size: [5,8,8,8] | ||
stride: [1,2,2,2] | ||
act_name: ${activation} | ||
|
||
# Classifier: for categorizing the input into classes | ||
classifier: | ||
_target_: retinal_rl.models.circuits.task_head.linear_classifier.LinearClassifier | ||
num_classes: 10 # Number of output classes |
19 changes: 0 additions & 19 deletions
19
resources/config_templates/user/dataset/cifar10-decontrast.yaml
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
# Configuration for the CIFAR10 dataset in classification experiments. | ||
|
||
name: cifar10 # Name of the dataset | ||
|
||
imageset: | ||
_target_: retinal_rl.dataset.Imageset | ||
source_transforms: | ||
- _target_: retinal_rl.datasets.transforms.ScaleShiftTransform | ||
vision_width: 160 | ||
vision_height: 160 | ||
image_rescale_range: [1, 5] | ||
noise_transforms: | ||
- _target_: retinal_rl.datasets.transforms.ShotNoiseTransform | ||
lambda_range: | ||
- ${eval:"0.5 if ${shot_noise_transform} else 1"} | ||
- ${eval:"1.5 if ${shot_noise_transform} else 1"} | ||
- _target_: retinal_rl.datasets.transforms.ContrastTransform | ||
contrast_range: | ||
- ${eval:"0.01 if ${contrast_noise_transform} else 1"} | ||
- ${eval:"1.2 if ${contrast_noise_transform} else 1"} | ||
- _target_: retinal_rl.datasets.transforms.IlluminationTransform | ||
brightness_range: | ||
- ${eval:"0.1 if ${brightness_noise_transform} else 1"} | ||
- ${eval:"1.5 if ${brightness_noise_transform} else 1"} | ||
- _target_: retinal_rl.datasets.transforms.BlurTransform | ||
blur_range: | ||
- ${eval:"0 if ${blur_noise_transform} else 1"} | ||
- ${eval:"2 if ${blur_noise_transform} else 1"} | ||
apply_normalization: true | ||
fixed_transformation: false | ||
multiplier: 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
19 changes: 19 additions & 0 deletions
19
resources/config_templates/user/sweep/recon-weight-sweep.yaml
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,19 @@ | ||
# This is a standard template for a wandb sweep. | ||
# See: https://docs.wandb.ai/guides/sweeps/define-sweep-configuration | ||
# | ||
# Sweeps can be initialized with retinal-rl from the command line with: | ||
# | ||
# python +experiment=experiment_name command=sweep | ||
|
||
description: Evaluating the effect of kernel size. | ||
program: main.py | ||
method: grid | ||
project: retinal-rl | ||
|
||
parameters: | ||
recon_weight_retina: | ||
values: [0,0.9,0.99,0.999,0.9999,1] | ||
recon_weight_thalamus: | ||
values: [0,0.9,0.99,0.999,0.9999,1] | ||
optimizer: | ||
value: "recon-weight" |
27 changes: 27 additions & 0 deletions
27
resources/config_templates/user/sweep/shallow-transform-sweep.yaml
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,27 @@ | ||
# This is a standard template for a wandb sweep. | ||
# See: https://docs.wandb.ai/guides/sweeps/define-sweep-configuration | ||
# | ||
# Sweeps can be initialized with retinal-rl from the command line with: | ||
# | ||
# python +experiment=experiment_name command=sweep | ||
|
||
description: Evaluating the effect of different combinations of transform. | ||
program: main.py | ||
method: grid | ||
project: retinal-rl | ||
|
||
parameters: | ||
activation: | ||
value: "elu" | ||
optimizer: | ||
value: "recon-weight" | ||
brain: | ||
value: "shallow-autoencoder" | ||
shot_noise_transform: | ||
values: [False,True] | ||
contrast_noise_transform: | ||
values: [False,True] | ||
brightness_noise_transform: | ||
values: [False,True] | ||
blur_noise_transform: | ||
values: [False,True] |