MCPcopy Create free account
hub / github.com/PolymathicAI/AstroCLIP / __init__

Method __init__

astroclip/modules.py:265–283  ·  view source on GitHub ↗
(
        self,
        shape: Union[int, Tuple[int, ...], torch.Size],
        eps: float = 1e-5,
        bias: bool = True,
        dtype=None,
    )

Source from the content-addressed store, hash-verified

263 eps: float
264
265 def __init__(
266 self,
267 shape: Union[int, Tuple[int, ...], torch.Size],
268 eps: float = 1e-5,
269 bias: bool = True,
270 dtype=None,
271 ):
272 super().__init__()
273
274 self.eps = eps
275 if isinstance(shape, numbers.Integral):
276 self.normalized_shape = (shape,)
277 else:
278 self.normalized_shape = tuple(shape)
279
280 self.weight = nn.Parameter(torch.empty(shape))
281 self.bias = nn.Parameter(torch.empty(shape)) if bias else None
282
283 self.reset_parameters()
284
285 def reset_parameters(self):
286 torch.nn.init.ones_(self.weight)

Callers

nothing calls this directly

Calls 2

reset_parametersMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected