Skip to content

Commit 47584e9

Browse files
authored
Merge pull request #2 from martinnovaak/403-quantization
Change quantization to 403
2 parents cb42a1f + 5d67ef3 commit 47584e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

trainer/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ def forward(self, batch: Batch):
3232
return torch.sigmoid(self.output_layer(hidden_features))
3333

3434
def clamp_weights(self):
35-
self.feature_transformer.weight.data.clamp_(-2.0, 2.0)
36-
self.output_layer.weight.data.clamp_(-2.0, 2.0)
35+
self.feature_transformer.weight.data.clamp_(-1.27, 1.27)
36+
self.output_layer.weight.data.clamp_(-1.27, 1.27)

trainer/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import struct
33
import numpy as np
44

5-
QA = 255
5+
QA = 403
66
QB = 64
77
QAB = QA * QB
88

0 commit comments

Comments
 (0)