Add spacing between functions in ziplm code
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
00005f45d3
commit
0e4c762c89
2 changed files with 1 additions and 0 deletions
Binary file not shown.
|
@ -179,6 +179,7 @@ class ZipModel:
|
||||||
for v in self.vocabulary
|
for v in self.vocabulary
|
||||||
])
|
])
|
||||||
return scipy.special.log_softmax(-code_lengths*self.conversion*(1/temperature))
|
return scipy.special.log_softmax(-code_lengths*self.conversion*(1/temperature))
|
||||||
|
|
||||||
def sample(self, prefix="", temperature=1):
|
def sample(self, prefix="", temperature=1):
|
||||||
scores = self.logprobs(prefix, temperature=temperature)
|
scores = self.logprobs(prefix, temperature=temperature)
|
||||||
i = np.random.choice(range(len(self.vocabulary)), p=np.exp(scores))
|
i = np.random.choice(range(len(self.vocabulary)), p=np.exp(scores))
|
||||||
|
|
Loading…
Reference in a new issue