File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,21 @@ pip install audio-diffusion-pytorch
1515## Usage
1616
1717``` py
18+ from audio_diffusion_pytorch import AudioDiffusionModel
19+
1820model = AudioDiffusionModel()
1921
2022# Train model with audio sources [batch, channels, samples]
21- x = torch.randn(2 , 1 , 2 ** 18 )
22- loss = net (x)
23- loss.backward()
23+ x = torch.randn(2 , 1 , 2 ** 18 ) # 2**18 ≈ 12s of audio at a frequency of 22050
24+ loss = model (x)
25+ loss.backward() # Do this many times
2426
2527# Sample given start noise
2628noise = torch.randn(2 , 1 , 2 ** 18 )
27- sampled = net .sample(
29+ sampled = model .sample(
2830 noise = noise,
29- num_steps = 5 # Suggested range: 1-100
30- ) # [2, 1, 2**18 ]
31+ num_steps = 5 # Suggested range: 2-50
32+ ) # [2, 1, 262144 ]
3133```
3234
3335## Usage with Components
You can’t perform that action at this time.
0 commit comments