manbeast3b commited on
Commit
bc2b087
·
verified ·
1 Parent(s): bf38739

Update src/loss.py

Browse files
Files changed (1) hide show
  1. src/loss.py +2 -2
src/loss.py CHANGED
@@ -46,12 +46,12 @@ class HierarchicalMatrix(torch.nn.Module):
46
  class LearnableScaler(torch.nn.Module):
47
  def __init__(self, size):
48
  super().__init__()
49
- self.scale_factors = torch.nn.Parameter(torch.rand(size, size))
50
  def forward(self, timestep):
51
  return self.scale_factors * torch.log(1 + timestep)
52
 
53
  class LossSchedulerModel(torch.nn.Module):
54
- def __init__(A,wx,we, strategy="hierarchical"):
55
  super(LossSchedulerModel,A).__init__()
56
  assert len(wx.shape)==1 and len(we.shape)==2
57
  B=wx.shape[0];assert B==we.shape[0]and B==we.shape[1]
 
46
  class LearnableScaler(torch.nn.Module):
47
  def __init__(self, size):
48
  super().__init__()
49
+ self.scale_factors = torch.nn.Parameter(torch.rand(size, size)).to('cuda')
50
  def forward(self, timestep):
51
  return self.scale_factors * torch.log(1 + timestep)
52
 
53
  class LossSchedulerModel(torch.nn.Module):
54
+ def __init__(A,wx,we, strategy="learnable_scaler"):
55
  super(LossSchedulerModel,A).__init__()
56
  assert len(wx.shape)==1 and len(we.shape)==2
57
  B=wx.shape[0];assert B==we.shape[0]and B==we.shape[1]