-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
658 additions
and
208 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,82 @@ | ||
# Release Notes | ||
|
||
## 0.0.1 - 2021-8-25 | ||
## 0.0.7 - 2021-11-26 | ||
* ☄️ comet integration [#129](https://github.com/gradsflow/gradsflow/pull/129) | ||
* add model checkpoint callback [#121](https://github.com/gradsflow/gradsflow/pull/121) | ||
* 📝 add csv logger [#116](https://github.com/gradsflow/gradsflow/pull/116) | ||
* 🚀 add train_eval_callback [#111](https://github.com/gradsflow/gradsflow/pull/111) | ||
* 🪄 add Average Meter [#109](https://github.com/gradsflow/gradsflow/pull/109) | ||
* fix device issue in metric calculation PR [#106](https://github.com/gradsflow/gradsflow/pull/106) | ||
|
||
* 📝 update example and documentation. Done by [ aniketmaurya](https://github.com/aniketmaurya). Check the [Pull Request 20 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/20). | ||
* :tada::sparkles: First Release - v0.0.1 - Refactor API & tested Python 3.7+. Done by [ aniketmaurya](https://github.com/aniketmaurya). Check the [Pull Request 18 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/18). | ||
* Adding example notebook for AutoSummarization. Done by [the GitHub user gagan3012](https://github.com/gagan3012). Check the [Pull Request 19 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/19). | ||
* Adding text summarisation. Done by [the GitHub user gagan3012](https://github.com/gagan3012). Check the [Pull Request 14 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/14). | ||
* add codecov CI. Done by [the GitHub user aniketmaurya](https://github.com/aniketmaurya). Check the [Pull Request 15 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/15). | ||
* 📚 update documentation - added citation, acknowledgments, docstrings automation. Done by [the GitHub user aniketmaurya](https://github.com/aniketmaurya). Check the [Pull Request 13 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/13). | ||
* Refactor API Design, CI & Docs PR [#10](https://github.com/gradsflow/gradsflow/pull/10) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* auto docstring. PR [#7](https://github.com/gradsflow/gradsflow/pull/7) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* Add AutoImageClassifier. PR [#1](https://github.com/gradsflow/gradsflow/pull/1) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
|
||
## 0.0.2 - 2021-8-27 | ||
## 0.0.6 - 2021-10-4 | ||
|
||
* Fix max steps validation key error. PR [#31](https://github.com/gradsflow/gradsflow/pull/31) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* 🎉 Revamp Callbacks and Training. PR [#94](https://github.com/gradsflow/gradsflow/pull/94) | ||
* ✨ refactor data handling 📝 docs update. PR [#91](https://github.com/gradsflow/gradsflow/pull/91) | ||
* integrate torchmetrics. PR [#80](https://github.com/gradsflow/gradsflow/pull/80) | ||
* callbacks & 🤑 ProgressCallback. PR [#76](https://github.com/gradsflow/gradsflow/pull/76) | ||
* 🔥 Add AutoModel Tuner. PR [#74](https://github.com/gradsflow/gradsflow/pull/74) | ||
* refactor APIs - Simplify API & add `model.compile(...)`. PR [#73](https://github.com/gradsflow/gradsflow/pull/73) | ||
* 🤗 integrate HF Accelerator. PR [#71](https://github.com/gradsflow/gradsflow/pull/71) | ||
|
||
## 0.0.3 - 2021-8-31 | ||
## 0.0.5 - 2021-9-26 | ||
|
||
* add optuna visualizations 🎨 . PR [#27](https://github.com/gradsflow/gradsflow/pull/27) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* add max_steps for HPO. PR [#25](https://github.com/gradsflow/gradsflow/pull/25) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* :memo: update docs & license. PR [#23](https://github.com/gradsflow/gradsflow/pull/23) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* fetch best trial model. PR [#21](https://github.com/gradsflow/gradsflow/pull/21) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* migrate to ray_tune 🌟. Read more [here](https://github.com/gradsflow/gradsflow/issues/35). PR [#36](https://github.com/gradsflow/gradsflow/pull/36) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* render jupyter notebooks in documentation. PR [#38](https://github.com/gradsflow/gradsflow/pull/38) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* 🔥 Add custom training loop with `model.fit`. PR [#63](https://github.com/gradsflow/gradsflow/pull/63) Done | ||
by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* ☁️ Add `ray.data` - remote dataset loader. PR [#61](https://github.com/gradsflow/gradsflow/pull/61) Done | ||
by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* 🎉 Add AutoDataset - Encapsulate datamodule and dataloaders. PR [#59](https://github.com/gradsflow/gradsflow/pull/59) | ||
Done by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* 🌟 Add Autotask feature. PR [#54](https://github.com/gradsflow/gradsflow/pull/54) Done | ||
by [@gagan3012](https://github.com/gagan3012) | ||
* ✨ Add AutoTrainer to support plain torch training loop and other torch frameworks. | ||
PR [#53](https://github.com/gradsflow/gradsflow/pull/53) | ||
|
||
## 0.0.4 - 2021-9-3 | ||
|
||
* fix best checkpoints model loading. PR [#52](https://github.com/gradsflow/gradsflow/pull/52) | ||
* 🚀 feature/fix train arguments docs PR [#44](https://github.com/gradsflow/gradsflow/pull/44) | ||
* Publish Python 🐍 distributions 📦 to PyPI [#42](https://github.com/gradsflow/gradsflow/pull/42) | ||
|
||
## 0.0.5 - 2021-9-26 | ||
* 🔥 Add custom training loop with `model.fit`. PR [#63](https://github.com/gradsflow/gradsflow/pull/63) Done by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* ☁️ Add `ray.data` - remote dataset loader. PR [#61](https://github.com/gradsflow/gradsflow/pull/61) Done by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* 🎉 Add AutoDataset - Encapsulate datamodule and dataloaders. PR [#59](https://github.com/gradsflow/gradsflow/pull/59) Done by [@aniketmaurya](https://github.com/aniketmaurya) | ||
* 🌟 Add Autotask feature. PR [#54](https://github.com/gradsflow/gradsflow/pull/54) Done by [@gagan3012](https://github.com/gagan3012) | ||
* ✨ Add AutoTrainer to support plain torch training loop and other torch frameworks. PR [#53](https://github.com/gradsflow/gradsflow/pull/53) | ||
## 0.0.3 - 2021-8-31 | ||
|
||
* add optuna visualizations 🎨 . PR [#27](https://github.com/gradsflow/gradsflow/pull/27) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* add max_steps for HPO. PR [#25](https://github.com/gradsflow/gradsflow/pull/25) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* :memo: update docs & license. PR [#23](https://github.com/gradsflow/gradsflow/pull/23) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* fetch best trial model. PR [#21](https://github.com/gradsflow/gradsflow/pull/21) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* migrate to ray_tune 🌟. Read more [here](https://github.com/gradsflow/gradsflow/issues/35). | ||
PR [#36](https://github.com/gradsflow/gradsflow/pull/36) by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* render jupyter notebooks in documentation. PR [#38](https://github.com/gradsflow/gradsflow/pull/38) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
|
||
## 0.0.6 - 2021-10-4 | ||
* 🎉 Revamp Callbacks and Training. PR [#94](https://github.com/gradsflow/gradsflow/pull/94) | ||
* ✨ refactor data handling 📝 docs update. PR [#91](https://github.com/gradsflow/gradsflow/pull/91) | ||
* integrate torchmetrics. PR [#80](https://github.com/gradsflow/gradsflow/pull/80) | ||
* callbacks & 🤑 ProgressCallback. PR [#76](https://github.com/gradsflow/gradsflow/pull/76) | ||
* 🔥 Add AutoModel Tuner. PR [#74](https://github.com/gradsflow/gradsflow/pull/74) | ||
* refactor APIs - Simplify API & add `model.compile(...)`. PR [#73](https://github.com/gradsflow/gradsflow/pull/73) | ||
* 🤗 integrate HF Accelerator. PR [#71](https://github.com/gradsflow/gradsflow/pull/71) | ||
## 0.0.2 - 2021-8-27 | ||
|
||
* Fix max steps validation key error. PR [#31](https://github.com/gradsflow/gradsflow/pull/31) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
|
||
## 0.0.1 - 2021-8-25 | ||
|
||
* 📝 update example and documentation. Done by [ aniketmaurya](https://github.com/aniketmaurya). Check | ||
the [Pull Request 20 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/20). | ||
* :tada::sparkles: First Release - v0.0.1 - Refactor API & tested Python 3.7+. Done | ||
by [ aniketmaurya](https://github.com/aniketmaurya). Check | ||
the [Pull Request 18 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/18). | ||
* Adding example notebook for AutoSummarization. Done by [the GitHub user gagan3012](https://github.com/gagan3012). | ||
Check the [Pull Request 19 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/19). | ||
* Adding text summarisation. Done by [the GitHub user gagan3012](https://github.com/gagan3012). Check | ||
the [Pull Request 14 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/14). | ||
* add codecov CI. Done by [the GitHub user aniketmaurya](https://github.com/aniketmaurya). Check | ||
the [Pull Request 15 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/15). | ||
* 📚 update documentation - added citation, acknowledgments, docstrings automation. Done | ||
by [the GitHub user aniketmaurya](https://github.com/aniketmaurya). Check | ||
the [Pull Request 13 with the changes and stuff](https://github.com/gradsflow/gradsflow/pull/13). | ||
* Refactor API Design, CI & Docs PR [#10](https://github.com/gradsflow/gradsflow/pull/10) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* auto docstring. PR [#7](https://github.com/gradsflow/gradsflow/pull/7) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). | ||
* Add AutoImageClassifier. PR [#1](https://github.com/gradsflow/gradsflow/pull/1) | ||
by [@aniketmaurya](https://github.com/aniketmaurya). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2021 GradsFlow. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import os | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
from gradsflow.callbacks.callbacks import Callback | ||
|
||
|
||
class ModelCheckpoint(Callback): | ||
def __init__(self, filename: Optional[str] = None, path: str = os.getcwd(), save_extra: bool = False): | ||
""" | ||
Saves Model checkpoint | ||
Args: | ||
filename: name of checkpoint | ||
path: folder path location of the model checkpoint | ||
save_extra: whether to save extra details like tracker | ||
""" | ||
super().__init__(model=None) | ||
filename = filename or "model" | ||
self.path = path | ||
self._dst = Path(path) / Path(filename) | ||
self.save_extra = save_extra | ||
|
||
def on_epoch_end(self): | ||
epoch = self.model.tracker.current_epoch | ||
path = f"{self._dst}_epoch={epoch}_.pt" | ||
self.model.save(path, save_extra=self.save_extra) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright (c) 2021 GradsFlow. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from loguru import logger | ||
|
||
from gradsflow.callbacks import Callback | ||
from gradsflow.utility.imports import requires | ||
|
||
|
||
class EmissionTrackerCallback(Callback): | ||
""" | ||
Tracks the carbon emissions produced by deep neural networks using | ||
[CodeCarbon](https://github.com/mlco2/codecarbon). To use this callback first install codecarbon using | ||
`pip install codecarbon`. | ||
For offline use, you must have to specify the [country code](https://github.com/mlco2/codecarbon#offline-mode). | ||
Args: | ||
offline: whether to use internet connection or not. You will have to provide the country code `country_iso_code` for offline use. | ||
**kwargs: passed directly to codecarbon class. | ||
""" | ||
|
||
_name = "EmissionTrackerCallback" | ||
|
||
@requires("codecarbon", "install codecarbon to use EmissionTrackerCallback") | ||
def __init__(self, offline: bool = False, **kwargs): | ||
from codecarbon import EmissionsTracker, OfflineEmissionsTracker | ||
|
||
if offline: | ||
self._emission_tracker = OfflineEmissionsTracker(**kwargs) | ||
else: | ||
self._emission_tracker = EmissionsTracker(**kwargs) | ||
self._emission_tracker.start() | ||
|
||
super().__init__(model=None) | ||
|
||
def on_fit_end(self): | ||
emissions: float = self._emission_tracker.stop() | ||
logger.info(f"Emissions: {emissions} kg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright (c) 2021 GradsFlow. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
from .comet import CometCallback | ||
from .logger import CSVLogger |
Oops, something went wrong.