From 251cb81c0de3e1a96c4c2a5290fb7ee2dd7a2493 Mon Sep 17 00:00:00 2001 From: Lauritz Timm <44357397+s9latimm@users.noreply.github.com> Date: Sat, 19 Oct 2024 02:49:14 +0200 Subject: [PATCH] Remove outlet --- src/nse/controller/simulation.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/nse/controller/simulation.py b/src/nse/controller/simulation.py index 9167dd8..f92d6b5 100644 --- a/src/nse/controller/simulation.py +++ b/src/nse/controller/simulation.py @@ -20,22 +20,18 @@ def __init__(self, experiment: Experiment, device: str, steps: int, layers: list knowledge = self.__experiment.knowledge.detach() learning = self.__experiment.learning.detach() inlet = self.__experiment.inlet.detach() - outlet = self.__experiment.outlet.detach() self.__u = torch.tensor([[i.u] for _, i in inlet + knowledge], dtype=torch.float64, device=self._device) self.__v = torch.tensor([[i.v] for _, i in inlet + knowledge], dtype=torch.float64, device=self._device) self.__null = torch.zeros(len(learning), 1, dtype=torch.float64, device=self._device) - self.__out = len(outlet) - self.__u_out = torch.zeros(len(outlet), 1, dtype=torch.float64, device=self._device) - self.__knowledge = ( - torch.tensor([[k.x] for k, _ in outlet + inlet + knowledge], + torch.tensor([[k.x] for k, _ in inlet + knowledge], dtype=torch.float64, requires_grad=True, device=self._device), - torch.tensor([[k.y] for k, _ in outlet + inlet + knowledge], + torch.tensor([[k.y] for k, _ in inlet + knowledge], dtype=torch.float64, requires_grad=True, device=self._device), @@ -91,12 +87,8 @@ def __loss(self): u, v, *_ = self.__forward(self.__knowledge) - u_loss = self._mse(u[self.__out:], self.__u) - v_loss = self._mse(v[self.__out:], self.__v) - - # # prohibits the model from hallucinating an incoming flow from right - # if self.__out > 0: - # u_loss += self._mse(torch.clamp(u[:self.__out], max=0), self.__u_out) + u_loss = self._mse(u, self.__u) + v_loss = self._mse(v, self.__v) *_, f, g = self.__forward(self.__learning, True)