added base class and methods; done logic for building graph

This commit is contained in:
evonneng committed 2022-04-12 19:36:55 +00:00
1 parent 69ea3ae45e
commit 39346ccf40
5 files changed
+80 -40

No files matched your search

+2 -9
View File
@@ -5,9 +5,10 @@ from typing import Optional
from torch import nn
from torchtyping import TensorType
from mattport.nerf.modules.module import Module
class MLP(nn.Module):
class MLP(Module):
"""Multilayer perceptron"""
def __init__(
@@ -54,14 +55,6 @@ class MLP(nn.Module):
self.net = nn.Sequential(*layers)
def set_in_dim(self, in_dim: int) -> None:
"""TODO: create base module class from which this extends"""
self.in_dim = in_dim
def get_out_dim(self) -> int:
"""TODO: create base module class from which this extends"""
return self.out_dim
def forward(self, in_tensor: TensorType[..., "in_dim"]) -> TensorType[..., "out_dim"]:
"""Process input with a multilayer perceptron.