File size: 920 Bytes
0675530
 
 
10c4986
 
 
 
 
 
 
2492040
 
 
 
10c4986
 
 
 
 
 
 
 
 
 
2492040
 
 
10c4986
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
license: mit
---

ghostmax/softmax1 trained on tinystories for 500M tokens.

ckpt will be out_* files trained 2 models 1 with regular softmax

REPO: https://github.com/joey00072/llama2.c/tree/ghostmax 

softmax: https://wandb.ai/shubhamchoudhari00072/ghostmax/reports/loss-val-23-08-25-21-48-58---Vmlldzo1MjM0MjUw <br>
ghostmax: https://wandb.ai/shubhamchoudhari00072/ghostmax/reports/loss-val-23-08-25-21-50-15---Vmlldzo1MjM0MjYw <br>
<br>

```python
def softmax(x, dim=None):
    e_x = torch.exp(x - torch.max(x, dim=dim, keepdim=True)[0]) 
    return e_x / e_x.sum(dim=dim, keepdim=True)    

def ghostmax(x, dim=None):
    e_x = torch.exp(x - torch.max(x, dim=dim, keepdim=True)[0]) 
    return e_x / (1+e_x.sum(dim=dim, keepdim=True) )

```
<br>
<iframe src="https://wandb.ai/shubhamchoudhari00072/ghostmax/runs/cbeei9uh?workspace=user-shubhamchoudhari00072" style="border:none;height:1024px;width:100%">
<br>