v0.3.0
This release touches most of the codebase.
Major Additions
- added
XYObjectShadedData
dataset, which is exactly the same asXYObjectData
but the ground truth factors differ. This might be useful for testing how metrics are affected by the ground truth representation of factors. Note that XYObjectData differs from previous versions due to this. - added
DSpritesImagenetData
dataset that is the same asDSpritesData
but masks that background or foreground depending on the mode and replaces the content with deterministic data from tiny-imagenet - added
disent.framework.vae.AdaGVaeMinimal
which is a minimal implementation ofAdaVae
configured to run ingvae
- added
disent.util.lightning.callbacks.VaeGtDistsLoggingCallback
which logs various distances matrices computed from averaged ground truth factor traversals. - Updated experiment files to use hydra 1.1
- can now switch between
train
andprepare_data
modes with the defaults grouprun_action=train
- can now switch between
Other Additions
- added
shallow_copy
todisent.dataset.DisentDataset
enabling a shallow copy of the dataset but overriding specific properties such as the transform - added new
disent.dataset.transform
includingToImgTensorF32
(wasToStandardisedTensor
) andToImgTensorU8
- additions to
H5Builder
add_dataset_from_array
that constructs and fills a dataset in the hdf5 file from an array- converted into context manager instead of manually opening the hdf5 file
- additions to
StateSpace
(and ground truth dataset child classes)normalise_factor_idx
convert names of ground truth factors into the numerical valuenormalise_factor_idxs
convert a name, an idx, lists of names, or lists of idxs to the numerical values of the ground truth factors.
disent.dataset.util.stats
addedcompute_data_mean_std(data)
to compute the mean and std of datasets- added
disent.schedule.SingleSchedule
- improved
disent.util.deprecate.deprecated
, now prints the stack trace for the call location of the deprecated function by default. This can be disabled. - added
restart
method todisent.util.profiling.Timer
for easy use within a loop - added
disent.util.vizualize.plot
which contains various matplotlib helper code used throughout the library and PyTorch lightning callbacks.
Breaking Changes
- removed confusing
observation_shape
andobs_shape
properties fromGroundTruthData
and any child classes. Any methods that require these properties across disent had their names update too. For example theArrayGroundTruthData
class now takesx_shape
.observation_shape
(H, W, C)
should be replaced withimg_shape
, you will need to update your overrides in child classesobs_shape
(C, H, W)
should be replaced withx_shape
XYObjectData
default parameters updated forXYObjectShadedData
, dataset and colour palettes differs slightly from previous versions.- moved module
disent.nn.transform
todisent.dataset.transform
- renamed
ToStandardisedTensor
toToImgTensorF32
- renamed
H5Builder
converted into context manager, similar API toopen
orh5py.File
ReconLossHandlerMse
changed to not scale or centre the output, this is because we now normalise the data instead which is more correctAdaVae
and inheriting classes have various functions renamed for claritydisent.metrics
functions haveground_truth_dataset
parameter renamed todataset
disent.model.ae
renamedDecoderTest
andEncoderTest
toDecoderLinear
andEncoderLinear
disent.registry
updated registry to use new more simple class structure and format. Some variables have been renamed, and registry names have been changed to plurals, eg.OPTIMIZER
is nowOPTIMIZERS
disent.schedule
cleaned up- renamed various variables and parameters
min_step
->start_step
,max_step
->end_step
- removed
disent.schedule.lerp.scale()
function, as it is the same aslerp
just not clipped
- renamed various variables and parameters
disent.util.lightning.callbacks.VaeDisentanglementLoggingCallback
renamed toVaeMetricLoggingCallback
docs.examples
updated to use newXYObjectData
version andToImgTensorF32
transform
Deprecations
- deprecated
ground_truth_data
property onDisentDataset
, this should be replaced with the shortergt_data
property. References toground_truth_data
have been replaced in disent.
Fixes
- Fixed
Mpi3dData
datasets, and added file hashes - Updated requirements
- Many minor fixes, usability and error message improvements
Hydra Experiment Changes
Hydra Config has finally been updated from version 1.0 to 1.1, adding support for recursive defaults and recursive instantiation. This allows is to remove all of our custom & hacky hydra helper code that previously enabled these features.
- hydra now supports recursive instantiation
- value based specialisation can now be done with recursive defaults using dummy groups
Updating hydra was a good opportunity to re-structure the configuration format.
- All settings defined in the root config that are referenced elsewhere are now in the
settings
key. - Default settings defined in various subgroups that are referenced elsewhere are often placed in the
dsettings
key. - Keys for various objects were renamed for clarity, eg.
augment.transform
was renamed toaugment.augment_cls
- All datasets now require the
meta.vis_mean
andmeta.vis_std
keys that are used both to normalise the dataset and used to re-scale it between [0, 1] for visualisation during training.
Every config file has been touched, the best approach is probably to look at the new system. The general structure remains the same, but the recursive defaults from Hydra 1.1 allows us to implement various things in a more clean way.
- new defaults group
run_launcher
to easily swap betweenslurm
andlocal
- defaults group
run_location
only specifies machine resources and paths - new defaults group
sampling
specifies details and the sampling strategy to be used by the frameworks - new defaults group
run_action
to switch betweentraining
and downloading and installing datasetsprepare_data