Skip to content
Snippets Groups Projects
Commit 0d5d0b4f authored by Krishna Krishna Nikhil's avatar Krishna Krishna Nikhil
Browse files

Update optimizer.py

parent b838ebc4
Branches main
No related tags found
No related merge requests found
...@@ -97,10 +97,10 @@ class Optimizer(object): ...@@ -97,10 +97,10 @@ class Optimizer(object):
def sigmoid(number): def sigmoid(number):
return 1/ (1 + torch.exp(-number)) return 1/ (1 + torch.exp(-number))
abs_sigm = sigmoid(scale_factor*(abs_parameters)) abs_sigm = sigmoid(scale_factor*(abs_parameters)) # Scaled sigmoid function
cost_abs = abs_sigm * 25 + (1 - abs_sigm) * 4.166 cost_abs = abs_sigm * 25 + (1 - abs_sigm) * 4.166 # 25 is the cost of Pb and 4.166 for Fe
scint_sigm = sigmoid(scale_factor*(scint_parameters)) scint_sigm = sigmoid(scale_factor*(scint_parameters))
cost_scint = scint_sigm * 2500 + (1 - scint_sigm) * 0.01 cost_scint = scint_sigm * 2500 + (1 - scint_sigm) * 0.01 # 2500 is the cost of PbWO4 and 0.01 for Polystyrene.
combined = torch.cat((cost_abs, cost_scint), dim=0) combined = torch.cat((cost_abs, cost_scint), dim=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment