Commit af4039a
committed
Fixed memory allocation bugs: no space for biases
Memory was allocated without space for biases. As the result of this some gradients were overwritten by weights, and some costs were overwritten by gradients.
You can see below that word vector positions inside W are calculated with additional space for bias, for example "l1 = (cr.word1 - 1LL) * (vector_size + 1)". Thus the memory allocation must also use additional space.
With this fix applied the algorithm tends to perform slightly better on provided analogy tests.1 parent db5a4d1 commit af4039a
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments