Skip to content

Commit

Permalink
Initial commit that uncovered the issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewoldag committed Oct 7, 2024
1 parent 8ca2e8f commit 1e0947c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 3 deletions.
70 changes: 70 additions & 0 deletions docs/notebooks/TrainingAModel.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import fibad"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fibad_instance = fibad.Fibad(config_file=\"../../src/fibad/fibad_default_config.toml\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fibad_instance.config[\"model\"][\"name\"] = \"ExampleCNN\"\n",
"fibad_instance.config[\"data_set\"][\"name\"] = \"CifarDataSet\"\n",
"fibad_instance.config[\"data_loader\"][\"num_workers\"] = 1"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fibad_instance.train()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "fibad",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
4 changes: 2 additions & 2 deletions src/fibad/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _validate_runtime_config(runtime_config: ConfigDict, default_config: ConfigD
"""
for key in runtime_config:
if key not in default_config:
msg = f"Runtime config contains key or section {key} which has no default defined."
msg = f"Runtime config contains key or section {key} which has no default defined. "

Check warning on line 107 in src/fibad/config_utils.py

View check run for this annotation

Codecov / codecov/patch

src/fibad/config_utils.py#L107

Added line #L107 was not covered by tests
msg += f"All configuration keys and sections must be defined in {DEFAULT_CONFIG_FILEPATH}"
raise RuntimeError(msg)

Expand Down Expand Up @@ -138,7 +138,7 @@ def resolve_runtime_config(runtime_config_filepath: Union[Path, str, None] = Non
"""Resolve a user-supplied runtime config to where we will actually pull config from.
1) If a runtime config file is specified, we will use that file
2) If not file is specified and there is a file named "fibad_config.toml" in the cwd we will use that file
2) If no file is specified and there is a file named "fibad_config.toml" in the cwd we will use that file
3) If no file is specified and there is no file named "fibad_config.toml" in the current working directory
we will exclusively work off the configuration defaults in the packaged "fibad_default_config.toml"
file.
Expand Down
2 changes: 1 addition & 1 deletion src/fibad/models/example_cnn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@fibad_model
class ExampleCNN(nn.Module):
def __init__(self, config, _):
def __init__(self, config, shape):
super().__init__()
self.conv1 = nn.Conv2d(3, 6, 5)
self.pool = nn.MaxPool2d(2, 2)
Expand Down

0 comments on commit 1e0947c

Please sign in to comment.