Skip to content

Commit

Permalink
feat: Use constructor from BuildModel to be able pass build_order
Browse files Browse the repository at this point in the history
  • Loading branch information
lRomul committed Jan 28, 2024
1 parent 5163e5c commit 59347ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ RUN pip3 install --no-cache-dir \

# Install requirements
COPY ./ ./
RUN pip3 install -e .[tests,docs,examples]
RUN pip3 install --no-cache-dir -e .[tests,docs,examples]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ https://pytorch-argus.readthedocs.io
## Installation

Requirements:
* torch>=1.1.0
* torch>=2.0.0

From pip:

Expand All @@ -31,7 +31,7 @@ pip install pytorch-argus
From source:

```bash
pip install -U git+https://github.com/lRomul/argus.git
pip install -U git+https://github.com/lRomul/argus.git@dev
```

## Example
Expand Down
11 changes: 5 additions & 6 deletions argus/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import argus
from argus import types
from argus.model.build import BuildModel
from argus.engine import Engine, State
from argus.callbacks import Callback, attach_callbacks
from argus.model.build import BuildModel
from argus.utils import deep_to, deep_detach
from argus.callbacks.logging import default_logging
from argus.callbacks import Callback, attach_callbacks
from argus.metrics.metric import Metric, attach_metrics
from argus.metrics.loss import Loss
from argus.utils import deep_to, deep_detach

__all__ = ["Model"]

Expand All @@ -34,6 +34,8 @@ class Model(BuildModel):
Args:
params (dict): A model parameters.
build_order (Iterable[str]): Order of building model attributes. The default
order is ('nn_module', 'optimizer', 'loss', 'device', 'prediction_transform').
Examples:
Expand Down Expand Up @@ -83,9 +85,6 @@ class FlexModel(argus.Model):
"""

def __init__(self, params: dict):
super().__init__(params)

def train_step(self, batch, state: State) -> dict:
"""Perform a single train step.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installation

Requirements:

* torch>=1.1.0
* torch>=2.0.0

You can use pip to install Argus:

Expand Down

0 comments on commit 59347ce

Please sign in to comment.