mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
Integrating logic for setting up optimizers in run_train and config files (#33)
* added optimizers * added optimizer logic for setting it up; todo-- fix optimizers and add step logic * typing out the alphabet
This commit is contained in:
1 parent
4d1a6b2dbd
commit
17d837babf
7 files changed
+59
-24
No files matched your search
@@ -3,6 +3,8 @@ Implementation of vanilla nerf.
|
||||
"""
|
||||
|
||||
|
||||
from typing import Dict, List
|
||||
from torch.nn import Parameter
|
||||
from torchtyping import TensorType
|
||||
|
||||
from mattport.nerf.field.nerf import NeRFField
|
||||
@@ -41,6 +43,17 @@ class NeRFGraph(Graph):
|
||||
# losses
|
||||
self.rgb_loss = MSELoss()
|
||||
|
||||
def get_param_groups(self) -> Dict[str, List[Parameter]]:
|
||||
"""Obtain the parameter groups for the optimizers
|
||||
|
||||
Returns:
|
||||
Dict[str, List[Parameter]]: Mapping of different parameter groups
|
||||
"""
|
||||
param_groups = {}
|
||||
param_groups["camera"] = [dict(params=self.ray_generator.parameters())]
|
||||
param_groups["graph"] = [dict(params=self.field_coarse.parameters()), dict(params=self.field_fine.parameters())]
|
||||
return param_groups
|
||||
|
||||
def forward(self, ray_indices: TensorType["num_rays", 3]):
|
||||
"""Takes in the ray indices and renders out values."""
|
||||
# get the rays:
|
||||
|
||||
Reference in new issue
Block a user