(self, inputs)
| 70 | self.activation = nn.Softplus(beta=100) |
| 71 | |
| 72 | def forward(self, inputs): |
| 73 | inputs = inputs * self.scale |
| 74 | if self.embed_fn_fine is not None: |
| 75 | inputs = self.embed_fn_fine(inputs) |
| 76 | |
| 77 | x = inputs |
| 78 | for l in range(0, self.num_layers - 1): |
| 79 | lin = getattr(self, "lin" + str(l)) |
| 80 | |
| 81 | if l in self.skip_in: |
| 82 | x = torch.cat([x, inputs], 1) / np.sqrt(2) |
| 83 | |
| 84 | x = lin(x) |
| 85 | |
| 86 | if l < self.num_layers - 2: |
| 87 | x = self.activation(x) |
| 88 | return torch.cat([x[:, :1] / self.scale, x[:, 1:]], dim=-1) |
| 89 | |
| 90 | def sdf(self, x): |
| 91 | return self.forward(x)[:, :1] |
no outgoing calls
no test coverage detected