Publish fixed regional-context item b entry and adopted item1b review with capacity hold
This commit is contained in:
1 parent
ffd5c92958
commit
31a20abd43
34 files changed
+16026
No files matched your search
@@ -0,0 +1,18 @@
|
||||
"""Original H2 initialization plus three zero-weight input columns, +384 parameters."""
|
||||
import torch
|
||||
from torch import nn
|
||||
from phase2_h2_model import H2Geo
|
||||
|
||||
|
||||
class H2Context(H2Geo):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
# No new random draws: shared parameters and subsequent RNG match H2.
|
||||
for layer in (self.encoder[0],self.head[0]):
|
||||
layer.weight=nn.Parameter(torch.cat([layer.weight.detach(),layer.weight.new_zeros((64,3))],dim=1))
|
||||
layer.in_features+=3
|
||||
|
||||
def forward(self,x,*args,**kwargs):
|
||||
if x.ndim!=2 or x.shape[1]!=22:
|
||||
raise ValueError('Exactly19 original plus2 context and1 validity columns')
|
||||
return super().forward(x,*args,**kwargs)
|
||||
Reference in new issue
Block a user