Skip to content

Commit

Permalink
fvgp version with fix for relative entropy
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusMNoack committed Dec 3, 2024
2 parents d9b9dab + 3ae786e commit 4edc665
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/kernel_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,21 @@ def forward(self, x):
x = self.fc3(x) # Hidden layer 2 to output layer
return x

def set_weights_biases(self, weights, biases):
weights = [torch.Tensor(entry) for entry in weights]
biases = [torch.Tensor(entry) for entry in biases]
with torch.no_grad():
model.fc1.weight = nn.Parameter(weights[0])
model.fc1.bias = nn.Parameter(biases[0])

model.fc2.weight = nn.Parameter(weights[1])
model.fc2.bias = nn.Parameter(biases[1])

model.fc3.weight = nn.Parameter(weights[2])
model.fc3.bias = nn.Parameter(biases[2])




# Initialize the network
#model = WarpNet()
Expand Down

0 comments on commit 4edc665

Please sign in to comment.