Skip to content

Commit f390239

Browse files
authored
Docs improvements (#1403)
* quickstart + core * + * + * + * docs
1 parent 7b41850 commit f390239

57 files changed

Lines changed: 180 additions & 229 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,44 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2323
-
2424

2525

26+
## [22.02] - 2022-02-13
27+
28+
### Tl;dr
29+
- Catalyst architecture simplification.
30+
- [#1395](https://github.com/catalyst-team/catalyst/issues/1395), [#1396](https://github.com/catalyst-team/catalyst/issues/1396), [#1397](https://github.com/catalyst-team/catalyst/issues/1397), [#1398](https://github.com/catalyst-team/catalyst/issues/1398), [#1399](https://github.com/catalyst-team/catalyst/issues/1399), [#1400](https://github.com/catalyst-team/catalyst/issues/1400), [#1401](https://github.com/catalyst-team/catalyst/issues/1401), [#1402](https://github.com/catalyst-team/catalyst/issues/1402), [#1403](https://github.com/catalyst-team/catalyst/issues/1403).
31+
32+
### Added
33+
34+
- Additional tests for different hardware accelerators setups. Please check out the `tests/pipelines` folder for more information.
35+
- `BackwardCallback` and `BackwardCallbackOrder` as an abstraction on top of `loss.backward`. Now you could easily log model gradients or transform them before `OptimizerCallback`.
36+
- `CheckpointCallbackOrder` for `ICheckpointCallback`.
37+
38+
### Changed
39+
40+
- Minimal python version moved to `3.7`, minimal pytorch version moved to `1.4.0`.
41+
- Engines rewritten on top of Accelerate. First, we found these two abstractions very close to each other. Second, Accelerate provides additional user-friendly API and more stable API for "Nvidia APEX" and "Facebook Fairscale" - it does not support them.
42+
- SelfSupervisedRunner moved to the `examples` folder from the Catalyst API. The only Runners API, that will be supported in the future: `IRunner`, `Runner`, `ISupervisedRunner`, `SupervisedRunner` due to their consistency. If you are interested in any other Runner API - feel free to write your own `CustomRunner` and use `SelfSupervisedRunner` as an example.
43+
- `Runner.{global/stage}_{batch/loader/epoch}_metrics` renamed to `Runner.{batch/loader/epoch}_metrics`
44+
- `CheckpointCallback` rewritten from scratch.
45+
- Catalyst registry moved to full-imports-paths only.
46+
- Logger API changed to receive `IRunner` for all `log_*` methods.
47+
- Metric API: `topk_args` renamed to `topk`
48+
- Contrib API: init imports from `catalyst.contrib` - removed, use `from catalyst.contrib.{smth} import {smth}`. Could be change to full-imports-only in future versions for stability.
49+
- All quickstarts, minimal examples, notebooks and pipelines moved to new version.
50+
- Codestyle moved to `89` right margin. Honestly speaking, it's much easier to maintain Catalyst with `89` right margin on MBP'16.
51+
52+
### Removed
53+
54+
- `ITrial` removed.
55+
- Stages support removed. While we embrace stages in deep learning experiments, current hardware accelerators are not prepared well for such setups. Additionally, ~95% of dl pipelines are single-stage. Multi-stage runner support is under review. For multi-stage support, please define a `CustomRunner` with rewritten API.
56+
- Config/Hydra API support removed. Config API is under review. For now, you could write your own Config API with [hydra-slayer](https://github.com/catalyst-team/hydra-slayer) if needed.
57+
- `catalyst-dl` scripts removed. Without Config API we don't need them anymore.
58+
- `Nvidia Apex`, `Fairscale`, `Albumentations`, `Nifti`, `Hydra` requiremets removed.
59+
- `OnnxCallback`, `PruningCallback`, `QuantizationCallback`, `TracingCallback` removed from callbacks API. Theese callbacks are under review now.
60+
61+
If you have any questions on the Catalyst 22 edition updates, please join Catalyst slack for discussion.
62+
63+
2664
## [21.12] - 2021-12-28
2765

2866
### Added

README.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,9 @@ from catalyst.contrib.datasets import MNIST
7575
model = nn.Sequential(nn.Flatten(), nn.Linear(28 * 28, 10))
7676
criterion = nn.CrossEntropyLoss()
7777
optimizer = optim.Adam(model.parameters(), lr=0.02)
78-
79-
train_data = MNIST(os.getcwd(), train=True)
80-
valid_data = MNIST(os.getcwd(), train=False)
8178
loaders = {
82-
"train": DataLoader(train_data, batch_size=32),
83-
"valid": DataLoader(valid_data, batch_size=32),
79+
"train": DataLoader(MNIST(os.getcwd(), train=True), batch_size=32),
80+
"valid": DataLoader(MNIST(os.getcwd(), train=False), batch_size=32),
8481
}
8582

8683
runner = dl.SupervisedRunner(
@@ -110,21 +107,18 @@ metrics = runner.evaluate_loader(
110107
loader=loaders["valid"],
111108
callbacks=[dl.AccuracyCallback(input_key="logits", target_key="targets", topk=(1, 3, 5))],
112109
)
113-
assert "accuracy01" in metrics.keys()
114110

115111
# model inference
116112
for prediction in runner.predict_loader(loader=loaders["valid"]):
117113
assert prediction["logits"].detach().cpu().numpy().shape[-1] == 10
118114

119-
features_batch = next(iter(loaders["valid"]))[0]
120-
# model tracing
121-
utils.trace_model(model=runner.model.cpu(), batch=features_batch)
122-
# model quantization
123-
utils.quantize_model(model=runner.model)
124-
# model pruning
125-
utils.prune_model(model=runner.model, pruning_fn="l1_unstructured", amount=0.8)
126-
# onnx export
127-
utils.onnx_export(model=runner.model.cpu(), batch=features_batch, file="./logs/mnist.onnx", verbose=True)
115+
# model post-processing
116+
model = runner.model.cpu()
117+
batch = next(iter(loaders["valid"]))[0]
118+
utils.trace_model(model=model, batch=batch)
119+
utils.quantize_model(model=model)
120+
utils.prune_model(model=model, pruning_fn="l1_unstructured", amount=0.8)
121+
utils.onnx_export(model=model, batch=batch, file="./logs/mnist.onnx", verbose=True)
128122
```
129123

130124
### Step-by-step Guide
@@ -188,6 +182,7 @@ Tested on Ubuntu 16.04/18.04/20.04, macOS 10.15, Windows 10, and Windows Subsyst
188182

189183
### Documentation
190184
- [master](https://catalyst-team.github.io/catalyst/)
185+
- [22.02](https://catalyst-team.github.io/catalyst/v22.02/index.html)
191186

192187
- <details>
193188
<summary>2021 edition</summary>

catalyst/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "22.02rc0"
1+
__version__ = "22.02"

catalyst/callbacks/backward.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class BackwardCallback(IBackwardCallback):
2020
.. note::
2121
Please follow the `minimal examples`_ sections for more use cases.
2222
23-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
23+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
2424
"""
2525

2626
def __init__(

catalyst/callbacks/criterion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CriterionCallback(FunctionalMetricCallback, ICriterionCallback):
1717
.. note::
1818
Please follow the `minimal examples`_ sections for more use cases.
1919
20-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
20+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
2121
"""
2222

2323
def __init__(

catalyst/callbacks/metrics/accuracy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class AccuracyCallback(BatchMetricCallback):
8888
.. note::
8989
Please follow the `minimal examples`_ sections for more use cases.
9090
91-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
91+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
9292
"""
9393

9494
def __init__(
@@ -180,7 +180,7 @@ class MultilabelAccuracyCallback(BatchMetricCallback):
180180
.. note::
181181
Please follow the `minimal examples`_ sections for more use cases.
182182
183-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
183+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
184184
"""
185185

186186
def __init__(

catalyst/callbacks/metrics/auc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class AUCCallback(LoaderMetricCallback):
7676
.. note::
7777
Please follow the `minimal examples`_ sections for more use cases.
7878
79-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
79+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
8080
"""
8181

8282
def __init__(

catalyst/callbacks/metrics/classification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class PrecisionRecallF1SupportCallback(BatchMetricCallback):
8080
.. note::
8181
Please follow the `minimal examples`_ sections for more use cases.
8282
83-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
83+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
8484
"""
8585

8686
def __init__(
@@ -187,7 +187,7 @@ class MultilabelPrecisionRecallF1SupportCallback(BatchMetricCallback):
187187
.. note::
188188
Please follow the `minimal examples`_ sections for more use cases.
189189
190-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
190+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
191191
"""
192192

193193
def __init__(

catalyst/callbacks/metrics/cmc_score.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def handle_batch(self, batch) -> None:
145145
.. note::
146146
Please follow the `minimal examples`_ sections for more use cases.
147147
148-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
148+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
149149
"""
150150

151151
def __init__(

catalyst/callbacks/metrics/confusion_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ConfusionMatrixCallback(Callback):
8989
.. note::
9090
Please follow the `minimal examples`_ sections for more use cases.
9191
92-
.. _`minimal examples`: http://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
92+
.. _`minimal examples`: https://github.com/catalyst-team/catalyst#minimal-examples # noqa: E501, W505
9393
"""
9494

9595
def __init__(

0 commit comments

Comments
 (0)