Skip to content

Commit 46376d6

Browse files
committed
Fixing issue with ConfigDict.
Also switching default data loader to CifarDataSet so 'fibad train' works out of the box
1 parent 6207ebc commit 46376d6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/fibad/config_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class ConfigDict(dict):
2424

2525
__slots__ = () # we don't need __dict__ on this object at all.
2626

27-
def __init__(self, map: dict, **kwargs):
28-
super().__init__(map, **kwargs)
27+
def __init__(self, *args, **kwargs):
28+
super().__init__(*args, **kwargs)
2929

3030
# Replace all dictionary keys with values recursively.
31-
for key in self:
32-
if isinstance(self[key], dict) and not isinstance(self[key], ConfigDict):
33-
self[key] = ConfigDict(map=self[key])
31+
for key, val in self.items():
32+
if isinstance(val, dict) and not isinstance(val, ConfigDict):
33+
self[key] = ConfigDict(val)
3434

3535
def __missing__(self, key):
3636
msg = f"Accessed configuration key/section {key} which has not been defined. "

src/fibad/fibad_default_config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ latent_dim =64
6464
[data_set]
6565
# Name of the built-in data loader to use or the libpath to an external data loader
6666
# e.g. "user_package.submodule.ExternalDataLoader" or "HSCDataLoader"
67-
name = "HSCDataLoader"
67+
name = "CifarDataSet"
6868

6969
[data_loader]
7070
# Pixel dimensions used to crop all images prior to loading. Will prune any images that are too small.

0 commit comments

Comments
 (0)