Exemplo n.º 1
0
def setup(obj):
    torch.set_num_threads(1)

    obj.path = torch.rand(obj.size, dtype=torch.float, requires_grad=True)
    shape = obj.size[-3], signatory.logsignature_channels(obj.size[-1], obj.depth)
    obj.grad = torch.rand(shape)
    obj.logsignature = signatory.LogSignature(obj.depth)(obj.path)
 def __init__(self, input_dim, order, N):
     super(Net, self).__init__()
     self.N = N
     self.order = order
     self.fc1 = nn.Linear(input_dim, 200)
     self.fc2 = nn.Linear(200, 200)
     self.fc3 = nn.Linear(200, N * 10)
     self.fc4 = nn.Linear(10, 1)
     self.logsig1 = signatory.LogSignature(depth=order)
def setup(obj):
    obj.path = torch.rand(obj.size,
                          dtype=torch.float,
                          requires_grad=True,
                          device='cuda')
    shape = obj.size[-3], signatory.logsignature_channels(
        obj.size[-1], obj.depth)
    obj.grad = torch.rand(shape, device='cuda')
    obj.logsignature = signatory.LogSignature(obj.depth)(obj.path)
Exemplo n.º 4
0
 def __init__(self, latent_dim, hidden_dim, output_dim, condition_dim,
              order, N, d):
     super().__init__(latent_dim, hidden_dim, output_dim, condition_dim)
     self.order = order
     self.N = N
     self.d = d
     self.fc1 = nn.Linear(output_dim, hidden_dim)
     self.fc2 = nn.Linear(hidden_dim, hidden_dim)
     self.fc3 = nn.Linear(hidden_dim, N * 10)
     self.fc4 = nn.Linear(10, d)
     self.logsig1 = signatory.LogSignature(depth=order)
 def __init__(self, input_dim, order, N, d):
     super(Net_time, self).__init__()
     self.level = np.array(
         [len(w) for w in signatory.lyndon_words(d + 1, order)])
     self.d = d
     self.N = N
     self.order = order
     self.fc1 = nn.Linear(input_dim, 200)
     self.fc2 = nn.Linear(200, 200)
     self.fc3 = nn.Linear(200, N * 10)
     self.fc4 = nn.Linear(10, self.d)
     self.logsig1 = signatory.LogSignature(depth=order)
def setup(obj):
    torch.set_num_threads(1)

    obj.path = torch.rand(obj.size, dtype=torch.float)
    obj.logsignature_instance = signatory.LogSignature(obj.depth)
    obj.logsignature_instance.prepare(obj.size[-1])
Exemplo n.º 7
0
def setup(obj):
    obj.path = torch.rand(obj.size, dtype=torch.float, device='cuda')
    obj.logsignature_instance = signatory.LogSignature(obj.depth)
    obj.logsignature_instance.prepare(obj.size[-1])