MCPcopy Create free account
hub / github.com/computational-imaging/bacon / __init__

Method __init__

modules.py:469–494  ·  view source on GitHub ↗
(self, out_features=1, nl='sine', in_features=1,
                 hidden_features=256, num_hidden_layers=3,
                 w0=30, pe_scale=5, use_sigmoid=True, no_pe=False,
                 is_sdf=False, **kwargs)

Source from the content-addressed store, hash-verified

467class CoordinateNet(nn.Module):
468 '''A canonical coordinate network'''
469 def __init__(self, out_features=1, nl='sine', in_features=1,
470 hidden_features=256, num_hidden_layers=3,
471 w0=30, pe_scale=5, use_sigmoid=True, no_pe=False,
472 is_sdf=False, **kwargs):
473
474 super().__init__()
475
476 self.nl = nl
477 dims = in_features
478 self.use_sigmoid = use_sigmoid
479 self.no_pe = no_pe
480 self.is_sdf = is_sdf
481
482 if self.nl != 'sine' and not self.no_pe:
483 in_features = hidden_features # in_features * hidden_features
484
485 self.pe = FFPositionalEncoding(hidden_features, pe_scale, dims=dims)
486
487 self.net = FCBlock(in_features=in_features,
488 out_features=out_features,
489 num_hidden_layers=num_hidden_layers,
490 hidden_features=hidden_features,
491 outermost_linear=True,
492 nonlinearity=nl,
493 w0=w0)
494 print(self)
495
496 def forward(self, model_input):
497

Callers

nothing calls this directly

Calls 3

FCBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected