hugofloresgarcia / vampnet

music generation with masked transformers!
https://hugo-does-things.notion.site/VampNet-Music-Generation-via-Masked-Acoustic-Token-Modeling-e37aabd0d5f1493aa42c5711d0764b33?pvs=4
MIT License
290 stars 35 forks source link

fixed seed gives different results (once) #24

Closed tig3rmast3r closed 9 months ago

tig3rmast3r commented 9 months ago

it looks there is a problem on how vars are passed to the mask generation, in fact when you fix the seed for generation, the first generation is different from all the subequent ones, so just to make an exmple, if i set the seed as 123456, without touching anything else:

looks like some vars are not passed correctly to the generation and it retains the last ones on the second pass values are correct i've identified the problem in the mask wav as it's different on the first pass i'm trying to understand what is happening but is out of my knowledge :)

I've tried with an older checkout too (before harp) and problem was there already, hope this helps

hugofloresgarcia commented 9 months ago

Ah, thanks for letting me know! Is there any chance you could provide some steps to reproduce the problem and know what's going wrong? Thanks!

tig3rmast3r commented 9 months ago

it happens all the times: -launch gradio default model -set seed with fixed number -generate -ganerate again -the 2nd and following generations will be the same, the fist generation will be different

problem is within the mask creation, it looks that first it creates the mask and then it assign the seed, so first generation is going to use the older seed value.

hugofloresgarcia commented 9 months ago

I see! Thanks so much!

tig3rmast3r commented 9 months ago

your commit was throwinhg errors this one works, thank you

def _vamp(data, return_mask=False): _seed = data[seed] if _seed != 0: at.util.seed(_seed)