diff --git a/configs/graph_instant_ngp.yaml b/configs/graph_instant_ngp.yaml index 924c50c0a..0b436c830 100644 --- a/configs/graph_instant_ngp.yaml +++ b/configs/graph_instant_ngp.yaml @@ -22,4 +22,5 @@ optimizers: fields: optimizer: lr: 1e-2 + eps: 1e-4 # for float16 stability scheduler: null diff --git a/pyrad/fields/instant_ngp_field.py b/pyrad/fields/instant_ngp_field.py index c62fa3de9..dd9f56497 100644 --- a/pyrad/fields/instant_ngp_field.py +++ b/pyrad/fields/instant_ngp_field.py @@ -101,7 +101,7 @@ class TCNNInstantNGPField(Field): network_config={ "otype": "FullyFusedMLP", "activation": "ReLU", - "output_activation": "None", + "output_activation": "Sigmoid", "n_neurons": hidden_dim_color, "n_hidden_layers": num_layers_color - 1, }, @@ -131,8 +131,8 @@ class TCNNInstantNGPField(Field): dtype = directions_flat.dtype d = self.direction_encoding(directions_flat) h = torch.cat([d, density_embedding.view(-1, self.geo_feat_dim)], dim=-1) - h = self.mlp_head(h).view(*ray_samples.frustums.directions.shape[:-1], -1).to(dtype) - rgb = torch.sigmoid(h) + rgb = self.mlp_head(h).view(*ray_samples.frustums.directions.shape[:-1], -1).to(dtype) + assert rgb.dtype is torch.float32 return {FieldHeadNames.RGB: rgb}