Repository navigation
v0.3.0
This release touches most of the codebase.
Major Additions
- added
XYObjectShadedDatadataset, which is exactly the same asXYObjectDatabut 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
DSpritesImagenetDatadataset that is the same asDSpritesDatabut masks that background or foreground depending on the mode and replaces the content with deterministic data from tiny-imagenet - added
disent.framework.vae.AdaGVaeMinimalwhich is a minimal implementation ofAdaVaeconfigured to run ingvae - added
disent.util.lightning.callbacks.VaeGtDistsLoggingCallbackwhich logs various distances matrices computed from averaged ground truth factor traversals. - Updated experiment files to use hydra 1.1
- can now switch between
trainandprepare_datamodes with the defaults grouprun_action=train
- can now switch between
Other Additions
- added
shallow_copytodisent.dataset.DisentDatasetenabling a shallow copy of the dataset but overriding specific properties such as the transform - added new
disent.dataset.transformincludingToImgTensorF32(wasToStandardisedTensor) andToImgTensorU8 - additions to
H5Builderadd_dataset_from_arraythat 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_idxconvert names of ground truth factors into the numerical valuenormalise_factor_idxsconvert a name, an idx, lists of names, or lists of idxs to the numerical values of the ground truth factors.
disent.dataset.util.statsaddedcompute_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
restartmethod todisent.util.profiling.Timerfor easy use within a loop - added
disent.util.vizualize.plotwhich contains various matplotlib helper code used throughout the library and PyTorch lightning callbacks.
Breaking Changes
- removed confusing
observation_shapeandobs_shapeproperties fromGroundTruthDataand any child classes. Any methods that require these properties across disent had their names update too. For example theArrayGroundTruthDataclass 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
XYObjectDatadefault parameters updated forXYObjectShadedData, dataset and colour palettes differs slightly from previous versions.- moved module
disent.nn.transformtodisent.dataset.transform- renamed
ToStandardisedTensortoToImgTensorF32
- renamed
H5Builderconverted into context manager, similar API toopenorh5py.FileReconLossHandlerMsechanged to not scale or centre the output, this is because we now normalise the data instead which is more correctAdaVaeand inheriting classes have various functions renamed for claritydisent.metricsfunctions haveground_truth_datasetparameter renamed todatasetdisent.model.aerenamedDecoderTestandEncoderTesttoDecoderLinearandEncoderLineardisent.registryupdated registry to use new more simple class structure and format. Some variables have been renamed, and registry names have been changed to plurals, eg.OPTIMIZERis nowOPTIMIZERSdisent.schedulecleaned 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 aslerpjust not clipped
- renamed various variables and parameters
disent.util.lightning.callbacks.VaeDisentanglementLoggingCallbackrenamed toVaeMetricLoggingCallbackdocs.examplesupdated to use newXYObjectDataversion andToImgTensorF32transform
Deprecations
- deprecated
ground_truth_dataproperty onDisentDataset, this should be replaced with the shortergt_dataproperty. References toground_truth_datahave been replaced in disent.
Fixes
- Fixed
Mpi3dDatadatasets, 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
settingskey. - Default settings defined in various subgroups that are referenced elsewhere are often placed in the
dsettingskey. - Keys for various objects were renamed for clarity, eg.
augment.transformwas renamed toaugment.augment_cls - All datasets now require the
meta.vis_meanandmeta.vis_stdkeys 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_launcherto easily swap betweenslurmandlocal - defaults group
run_locationonly specifies machine resources and paths - new defaults group
samplingspecifies details and the sampling strategy to be used by the frameworks - new defaults group
run_actionto switch betweentrainingand downloading and installing datasetsprepare_data