Skip to content

Commit d0c6b36

Browse files
committed
math comment fix
1 parent 14fb057 commit d0c6b36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

labml_nn/transformers/switch/experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def step(self, batch: any, batch_idx: BatchIndex):
114114
# Total number of tokens processed, $T$, in the current batch $\mathscr{B}$
115115
total = counts.sum(dim=-1, keepdims=True)
116116
# Fraction of tokens routed to each expert
117-
# $$f_i = \frac{1}{T} \sum_{x \in \mathscr{B}} \unicode{x1D7D9} \{ \mathop{argmax} p(x), i \}$$
117+
# $$f_i = \frac{1}{T} \sum_{x \in \mathscr{B}} \mathbf{1} \{ \mathop{argmax} p(x), i \}$$
118118
# $f_i$ is the count of tokens where the argmax of $p(x)$ is equal to $i$.
119119
route_frac = counts / total
120120
# Mean routing probability

0 commit comments

Comments
 (0)