Skip to content

Commit 4a99051

Browse files
committed
log/exp and sqrt/square work better than softplus
1 parent f57826c commit 4a99051

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

neuralfields/param_tranform.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

neuralfields/potential_based.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from torch.nn.utils import convert_parameters
88

99
from neuralfields.custom_types import ActivationFunction
10-
from neuralfields.param_tranform import inv_softplus
1110

1211

1312
class PotentialBased(nn.Module, ABC):
@@ -17,13 +16,13 @@ class PotentialBased(nn.Module, ABC):
1716
_kappa_opt: Union[torch.Tensor, nn.Parameter]
1817

1918
_tau_min: Union[float, int] = 1e-5
20-
"""Minimum value for the time constant $\tau$ to avoid numerical instabilities."""
19+
r"""Minimum value for the time constant $\tau$ to avoid numerical instabilities."""
2120
_potentials_max: Union[float, int] = 100
2221
"""Threshold to clip the potentials symmetrically (at a very large value) for numerical stability."""
2322

24-
transform_to_opt_space: Callable[[torch.Tensor], torch.Tensor] = inv_softplus
23+
transform_to_opt_space: Callable[[torch.Tensor], torch.Tensor] = torch.log
2524
"""Function to map parameters to the optimization space."""
26-
transform_to_img_space: Callable[[torch.Tensor], torch.Tensor] = torch.nn.functional.softplus
25+
transform_to_img_space: Callable[[torch.Tensor], torch.Tensor] = torch.exp
2726
"""Function to map parameters to the image space of the original problem."""
2827

2928
def __init__(

0 commit comments

Comments
 (0)