aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2024-06-14 15:53:19 -0500
committerAnthony Wang2024-06-14 15:53:19 -0500
commit0e4c762c897aa9046fb170c5c7f2203a0934b2f7 (patch)
treebe40fe524bf22c1fc6189e88cb44212183ae67d7
parent00005f45d3006b1c11b94df1b95679be5ff39e87 (diff)
Add spacing between functions in ziplm code
-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))