aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/src/gzip-classification.pdfbin131109 -> 131146 bytes
-rw-r--r--static/src/gzip-classification.tex1
2 files changed, 1 insertions, 0 deletions
diff --git a/static/src/gzip-classification.pdf b/static/src/gzip-classification.pdf
index af2a857..1179ee7 100644
--- a/static/src/gzip-classification.pdf
+++ b/static/src/gzip-classification.pdf
Binary files differ
diff --git a/static/src/gzip-classification.tex b/static/src/gzip-classification.tex
index 74282d8..7b414cb 100644
--- a/static/src/gzip-classification.tex
+++ b/static/src/gzip-classification.tex
@@ -179,6 +179,7 @@ class ZipModel:
for v in self.vocabulary
])
return scipy.special.log_softmax(-code_lengths*self.conversion*(1/temperature))
+
def sample(self, prefix="", temperature=1):
scores = self.logprobs(prefix, temperature=temperature)
i = np.random.choice(range(len(self.vocabulary)), p=np.exp(scores))