Skip to content

Commit e3b75c7

Browse files
fix: readme
1 parent 2d40336 commit e3b75c7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ pip install audio-diffusion-pytorch
1515
## Usage
1616

1717
```py
18+
from audio_diffusion_pytorch import AudioDiffusionModel
19+
1820
model = 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
2628
noise = 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

0 commit comments

Comments
 (0)