timbmg / Sentence-VAE

PyTorch Re-Implementation of "Generating Sentences from a Continuous Space" by Bowman et al 2015 https://arxiv.org/abs/1511.06349

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maybe a bug in the kl_anneal_function

linzhk opened this issue · comments

in the function :

def kl_anneal_function(anneal_function, step, k, x0):

    if anneal_function == 'logistic':  

        return float(1/(1+np.exp(-k*(step-x0))))  

    elif anneal_function == 'linear':  

        return min(1, step/x0)  

you will see k is a str.that is wrong and i change it into 1

It shouldn't be a string. It comes from the command line, see here:
parser.add_argument('-k', '--k', type=float, default=0.0025)