Commit 159001d8 authored by Andrei Roibu's avatar Andrei Roibu
Browse files

prepared execution of first VA code + fixed bugs

parent 1515a03b
...@@ -62,9 +62,9 @@ class Solver(): ...@@ -62,9 +62,9 @@ class Solver():
experiment_name, experiment_name,
optimizer, optimizer,
optimizer_arguments={}, optimizer_arguments={},
# loss_function=MSELoss(), loss_function=MSELoss(),
# loss_function=torch.nn.L1Loss(), # loss_function=torch.nn.L1Loss(),
loss_function=torch.nn.CosineEmbeddingLoss(), # loss_function=torch.nn.CosineEmbeddingLoss(),
model_name='BrainMapper', model_name='BrainMapper',
labels=None, labels=None,
number_epochs=10, number_epochs=10,
...@@ -208,9 +208,8 @@ class Solver(): ...@@ -208,9 +208,8 @@ class Solver():
y_hat = torch.mul(y_hat, MNI152_T1_2mm_brain_mask) y_hat = torch.mul(y_hat, MNI152_T1_2mm_brain_mask)
# loss = self.loss_function(y_hat, y) # Loss computation loss = self.loss_function(y_hat, y) # Loss computation
loss = self.loss_function( # loss = self.loss_function(y_hat+1e-4, y+1e-4, torch.tensor(1.0).cuda(self.device, non_blocking=True))
y_hat+1e-4, y+1e-4, torch.tensor(1.0).cuda(self.device, non_blocking=True))
# We also calculate a separate MSE for cost function comparison! # We also calculate a separate MSE for cost function comparison!
MSE = self.MSE(y_hat, y) MSE = self.MSE(y_hat, y)
......
...@@ -309,8 +309,8 @@ class ResNetClassifierBlock3D(nn.Module): ...@@ -309,8 +309,8 @@ class ResNetClassifierBlock3D(nn.Module):
self.normalization = nn.InstanceNorm3d( self.normalization = nn.InstanceNorm3d(
num_features=parameters['number_of_classes']) num_features=parameters['number_of_classes'])
# self.activation = nn.Sigmoid() self.activation = nn.Sigmoid()
self.activation = nn.Tanh() # self.activation = nn.Tanh()
# TODO: Might be wworth looking at GANS for image generation, and adding padding # TODO: Might be wworth looking at GANS for image generation, and adding padding
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment