-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate diffusion models in gt4sd (#128)
* wip: skeleton diffusion * wip: add implementation, core * wip: add diffusion models and noise scheduler support * wip: add tests * fix: fix imports * wip: black files * feat: add modality, minor fix * fix: minor fix tests * fix tests * add tests * add training_pipeline for diffusion * minor change * remove double reqs * set ubuntu version ci * ci: relax latest, fix examples * add diffusion-trainer, test diffusion training_pipeline * skip high-memory tests * minor change * fix: segfaults on ulinux for rdkit/torchvision conflicts * fix tests, add demo * fix model_types * improve tests * feat: add notebook for text2image, improve testing * fix tests, skip auth_token, skip slow_sampling * separate tests unconditional and text-conditional * fix reqs * add tests for diffusion training_pipeline * add stable-diffusion in notebook, use conditional reqs * fix conda.yml path * minor changes, explicit name training_pipeline for image generation * fix reqs * change training_pipeline name for consistency * use common interface for sampling, add target, improve notebook, fix issue with hashable * feat: simplifying sampling logic. Signed-off-by: Matteo Manica <[email protected]> * fix: pass prompt in configuration * fix style, update notebook * black files * refactor sample Signed-off-by: Matteo Manica <[email protected]> Co-authored-by: Jannis Born <[email protected]> Co-authored-by: Matteo Manica <[email protected]>
- Loading branch information
1 parent
10319c4
commit 94de023
Showing
20 changed files
with
1,905 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -145,5 +145,5 @@ oracle | |
# local tests | ||
_main_* | ||
|
||
# data | ||
# data folder | ||
data/ |
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,6 +1,8 @@ | ||
from gt4sd.frameworks.granular.train.core import parse_arguments_from_config, train_granular | ||
from gt4sd.frameworks.granular.train.core import ( | ||
parse_arguments_from_config, | ||
train_granular, | ||
) | ||
|
||
args = parse_arguments_from_config("config_ae.ini") | ||
|
||
train_granular(vars(args)) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,45 @@ | ||
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2022 GT4SD team | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
# | ||
"""DiffusersGenerationAlgorithm initialization.""" | ||
|
||
from .core import ( | ||
DDIMGenerator, | ||
DDPMGenerator, | ||
DiffusersGenerationAlgorithm, | ||
LDMGenerator, | ||
LDMTextToImageGenerator, | ||
ScoreSdeGenerator, | ||
StableDiffusionGenerator, | ||
) | ||
|
||
__all__ = [ | ||
"DiffusersGenerationAlgorithm", | ||
"DDPMGenerator", | ||
"DDIMGenerator", | ||
"DiffusionGenerator", | ||
"StableDiffusionGenerator", | ||
"ScoreSdeGenerator", | ||
"LDMGenerator", | ||
"LDMTextToImageGenerator", | ||
] |
Oops, something went wrong.