Skip to content

Commit

Permalink
Add load_bricks and save_bricks
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-machine committed Apr 11, 2024
1 parent 1b83a32 commit 1fb476d
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 135 deletions.
16 changes: 10 additions & 6 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1052,18 +1052,22 @@
"##\n",
"\n",
"## What are we missing?\n",
"- [ ] Saving-loading brick collections\n",
"- [x] Saving-loading brick collections\n",
" - The user is able to define a model in code and from config (From config require it as an argument in the init-function?)\n",
" - The user will easily load some parts of the model and train from scratch for other parts. \"auto\", \"none\", \"strict\"\n",
" - I have decided to only provide a \"path_weights\" in each brick collection. Each brick collection will load weights if the weights exists in a given folder. wrong path -> error, missing path -> warning of module (warning), warning in case a file is not used? \n",
" - Currently, this option supports training sub-node from scratch by removing the weight file from the folder.\n",
" - [ ] Create an example in README\n",
"- [ ] Move parts generic parts from model-trainer to torch-bricks\n",
"- [ ] A user can pass in both stage as a str and as an enum. (It is always a string internally). String makes it easier to jit trace and we\n",
" a user can create self-defined stages. \n",
"- [ ] Demonstrate model configuration with hydra in this document\n",
"- [ ] Add stage as an internal state and not in the forward pass:\n",
" - Minor Pros: Tracing (to get onnx model) requires 'torch.Tensors' only as input - we avoid making an adapter class. \n",
" - Minor Cons: State gets hidden away - implicit instead of explicit.\n",
" - Minor Pros: Similar to eval/training in pytorch\n",
" - Minor Pros: The forward call does not require the user to always pass the stage - less typing.\n",
"- [ ] A user can pass in both stage as a str and as an enum. (It is always a string internally). String makes it easier to jit trace and we\n",
" a user can create self-defined stages. \n",
"- [ ] Demonstrate model configuration with hydra in this document\n",
"Update version!\n",
"\n",
"- [ ] Make common Visualizations with pillow - not opencv to not blow up the required dependencies. ImageClassification, Segmentation, ObjectDetection\n",
" - [ ] VideoModule to store data as a video\n",
" - [ ] DisplayModule to show data\n",
Expand Down Expand Up @@ -1118,7 +1122,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,18 +818,22 @@ The main motivation:
##

## What are we missing?
- [ ] Saving-loading brick collections
- [x] Saving-loading brick collections
- The user is able to define a model in code and from config (From config require it as an argument in the init-function?)
- The user will easily load some parts of the model and train from scratch for other parts. "auto", "none", "strict"
- I have decided to only provide a "path_weights" in each brick collection. Each brick collection will load weights if the weights exists in a given folder. wrong path -> error, missing path -> warning of module (warning), warning in case a file is not used?
- Currently, this option supports training sub-node from scratch by removing the weight file from the folder.
- [ ] Create an example in README
- [ ] Move parts generic parts from model-trainer to torch-bricks
- [ ] A user can pass in both stage as a str and as an enum. (It is always a string internally). String makes it easier to jit trace and we
a user can create self-defined stages.
- [ ] Demonstrate model configuration with hydra in this document
- [ ] Add stage as an internal state and not in the forward pass:
- Minor Pros: Tracing (to get onnx model) requires 'torch.Tensors' only as input - we avoid making an adapter class.
- Minor Cons: State gets hidden away - implicit instead of explicit.
- Minor Pros: Similar to eval/training in pytorch
- Minor Pros: The forward call does not require the user to always pass the stage - less typing.
- [ ] A user can pass in both stage as a str and as an enum. (It is always a string internally). String makes it easier to jit trace and we
a user can create self-defined stages.
- [ ] Demonstrate model configuration with hydra in this document
Update version!

- [ ] Make common Visualizations with pillow - not opencv to not blow up the required dependencies. ImageClassification, Segmentation, ObjectDetection
- [ ] VideoModule to store data as a video
- [ ] DisplayModule to show data
Expand Down
Loading

0 comments on commit 1fb476d

Please sign in to comment.