New modalities
See original GitHub issueOne of the stated design decisions from the readme was to support arbitrary modalities, not just images.
I’m in the process of trying to adapt the code for 1D vectors (not H x W x C images).
this line:
noisy_images = noise_scheduler.training_step(clean_inputs, noise_samples, timesteps)
adapted from train_unconditional.py, takes in a (16, 198) clean_inputs tensor and returns a (16, 1, 16, 198) noisy_images tensor. So, 1D tensors are not working out of the box. I am just curious if I am taking the right approach to get 1D tensors to work or there’s no avoiding custom coding a new DDPMScheduler etc.
EDIT: I got the DDPM training_step function to work with this change:
if len(original_samples.shape) == 2:
timesteps = timesteps.unsqueeze(-1)
else:
timesteps = timesteps.reshape(batch_size, 1, 1, 1)
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
New Chemical Modalities and Strategic Thinking in Early Drug ...
New chemical modalities including RNA therapeutics, protein degraders, cyclopeptides, antibody drug conjugates, and gene therapy have ...
Read more >Next generation therapeutics - AstraZeneca
In fact, 30% of our early pipeline now consists of new drug modalities including oligonucleotides, mRNA and Anticalin ® proteins.
Read more >New Modalities for Challenging Targets in Drug Discovery
Generally speaking, new modalities may be seen as a concept to address biological targets in the most effective way, by leveraging the strengths ......
Read more >Emerging modalities of medicine - USP
Medicine is advancing rapidly, with new technologies and treatment modalities being developed to meet the unique needs of patients. These modalities range ...
Read more >New therapeutic modalities in drug discovery and development
Moreover, the introduction of new therapeutic modalities, besides the so-called classical Rule of 5 (Ro5) [7] compliant molecules, has had some impact.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@anton-l @patrickvonplaten Thanks for your input thus far.
I took the latest commit (as of this moment) and made a minimum reproduction of a 1D MLP model and training.
I had to make an additional modification to
pipeline_ddpm.py
to support noise samples of the right shape.bimodal_testt.zip
python3 train_unconditional_gaussian_test.py
This runs a test on a bimodal gaussian distribution centered at +33, -33 with low varianceIt seems to not capture the -33 mode after an epoch or two. Am running the training overnight to see what happens.
Welcome you guys to try running this to see if there’s anything I did wrong
Taking a look at the function as is:
Note that the input can be both
torch
andnumpy
tensors -> this should be changed.Also there shouldn’t be any
.to(device)
statements, nor framework and modality spefific.reshape(...)
operation.I’d be in favor of implementing framework specific (one for PT one for TF) functions called
def extract(....)
inSchedulerMixin
that haveif framework == "pt"
statements in them. Also note that we shouldn’t assume to know the dimension of the inputoriginal_samples