class CPC15_BEASTpred2(torch.nn.Module):
def __init__(self):
    super(CPC15_BEASTpred2, self).__init__()
    self.CPC18_getDist = CPC18_getDist2()
    self.CPC15_BEASTsimulation = CPC15_BEASTsimulation2()
    self.SIGMA = torch.nn.parameter.Parameter(torch.tensor(7, dtype=torch.float32, requires_grad=True))
    self.KAPA = torch.nn.parameter.Parameter(torch.tensor(3, dtype=torch.float32, requires_grad=True))
    self.BETA = torch.nn.parameter.Parameter(torch.tensor(2.6, dtype=torch.float32, requires_grad=True))
    self.GAMA = torch.nn.parameter.Parameter(torch.tensor(0.5, dtype=torch.float32, requires_grad=True))
    self.PSI = torch.nn.parameter.Parameter(torch.tensor(0.07, dtype=torch.float32, requires_grad=True))
    self.THETA = torch.nn.parameter.Parameter(torch.tensor(1, dtype=torch.float32, requires_grad=True))

def forward(self, Ha, pHa, La, LotShapeA, LotNumA, Hb, pHb, Lb, LotShapeB, LotNumB, Amb, Corr,B_rate):
    DistA = self.CPC18_getDist(Ha, pHa, La, LotShapeA, LotNumA)
    DistB = self.CPC18_getDist(Hb, pHb, Lb, LotShapeB, LotNumB)
    Prediction = torch.zeros( size=(5,1), dtype=torch.float32, requires_grad=True)
    nSims = 1
    for sim in range(0, nSims):
        simPred = self.CPC15_BEASTsimulation(DistA, DistB, Amb, Corr,self.SIGMA,self.KAPA,self.BETA,self.GAMA,self.PSI,self.THETA)
        Prediction = torch.add(Prediction, (1 / nSims) * simPred)
    return Prediction