Skip to content

Commit

Permalink
Allowing to optimize only the latent code
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardramon committed Dec 23, 2020
1 parent a9a4490 commit 04c3112
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/models/idr_prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,18 @@ def __init__(
weight_norm=True,
multires=0,
latent_size=256,
deep_sdf_weights=None):
deep_sdf_weights=None,
deep_sdf_trainable=False):

super().__init__()

self.deep_sdf = DeepSDFNetwork(latent_size+d_in, d_out, dims, geometric_init,
bias, skip_in, weight_norm, multires, deep_sdf_weights)

if not deep_sdf_trainable:
for p in self.deep_sdf.parameters():
p.requires_grad = False

self.latent = torch.nn.Parameter(data=torch.Tensor(latent_size), requires_grad=True)
self.latent.data.normal_(0.0, 1/latent_size)

Expand Down

0 comments on commit 04c3112

Please sign in to comment.