mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-29 04:20:10 +08:00
dataloader logic, new folder structure, flatter configs (#26)
* renaming dataloader to data. adding some dataloader classes * restructuring configs * fixed instant ngp tcnn direction rescaling * working through test cases * black and lint and tests
This commit is contained in:
1 parent
24c1c77ef1
commit
457788d689
105 files changed
+8828
-682
No files matched your search
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
MLP Test
|
||||
"""
|
||||
import torch
|
||||
from torch import nn
|
||||
|
||||
from pyrad.fields.modules import MLP
|
||||
|
||||
|
||||
def test_mlp():
|
||||
"""Test mlp"""
|
||||
in_dim = 6
|
||||
out_dim = 10
|
||||
num_layers = 2
|
||||
layer_width = 32
|
||||
out_activation = nn.ReLU()
|
||||
mlp = MLP(
|
||||
in_dim=in_dim, out_dim=out_dim, num_layers=num_layers, layer_width=layer_width, out_activation=out_activation
|
||||
)
|
||||
assert mlp.get_out_dim() == out_dim
|
||||
|
||||
x = torch.ones((9, in_dim))
|
||||
|
||||
mlp.build_nn_modules()
|
||||
y = mlp(x)
|
||||
|
||||
assert y.shape[-1] == out_dim
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_mlp()
|
||||
Reference in new issue
Block a user