MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/nn/activations.py:101–103  ·  view source on GitHub ↗
(self, num_parameters=1, init=0.25)

Source from the content-addressed store, hash-verified

99
100class PReLU(nn.Module):
101 def __init__(self, num_parameters=1, init=0.25):
102 super().__init__()
103 self.weight = nn.Parameter(torch.ones(num_parameters) * init)
104
105 def forward(self, x):
106 return torch.where(x > 0, x, self.weight * x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected