MCPcopy Create free account
hub / github.com/NVlabs/tiny-cuda-nn / __init__

Method __init__

scripts/test_random_input.py:15–27  ·  view source on GitHub ↗
(
		self, in_features, out_features,
		num_hidden_layers, hidden_features,
		activation:str='ReLU', last_activation:str='None',
		seed=42)

Source from the content-addressed store, hash-verified

13
14class TcnnFCBlock(tcnn.Network):
15 def __init__(
16 self, in_features, out_features,
17 num_hidden_layers, hidden_features,
18 activation:str='ReLU', last_activation:str='None',
19 seed=42):
20 assert hidden_features in [16, 32, 64, 128], "hidden_features can only be 16, 32, 64, or 128."
21 super().__init__(in_features, out_features, network_config={
22 "otype": "FullyFusedMLP", # Component type.
23 "activation": activation, # Activation of hidden layers.
24 "output_activation": last_activation, # Activation of the output layer.
25 "n_neurons": hidden_features, # Neurons in each hidden layer. # May only be 16, 32, 64, or 128.
26 "n_hidden_layers": num_hidden_layers, # Number of hidden layers.
27 }, seed=seed)
28
29 def forward(self, x: torch.Tensor):
30 prefix = x.shape[:-1]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected