xiph / LPCNet

Efficient neural speech synthesis
BSD 3-Clause "New" or "Revised" License
1.12k stars 295 forks source link

Issue in Sparsify? #10

Closed bpotard closed 5 years ago

bpotard commented 5 years ago

In lpcnet.py, the following line do not seem to have the intended effect:

if self.batch < self.t_start or ((self.batch-self.t_start) % self.interval != 0 and self.batch < self.t_end):
            #print("don't constrain");
            pass

I assume the intention is to run the "sparsification" every self.interval from self.t_start to self.t_end. However, what it actually does is, in addition to this, run it for every single batch after self.t_end.

So I suggest the following correction:

if self.batch < self.t_start or ((self.batch-self.t_start) % self.interval != 0) or self.batch >= self.t_end:
            #print("don't constrain");
            pass
jmvalin commented 5 years ago

That behaviour is intended. Once the model has reached the desired sparseness, then it needs to remain that way.