MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

sat/sgm/modules/autoencoding/losses/lpips.py:9–25  ·  view source on GitHub ↗
(
        self,
        decoder_config,
        perceptual_weight=1.0,
        latent_weight=1.0,
        scale_input_to_tgt_size=False,
        scale_tgt_to_input_size=False,
        perceptual_weight_on_inputs=0.0,
    )

Source from the content-addressed store, hash-verified

7
8class LatentLPIPS(nn.Module):
9 def __init__(
10 self,
11 decoder_config,
12 perceptual_weight=1.0,
13 latent_weight=1.0,
14 scale_input_to_tgt_size=False,
15 scale_tgt_to_input_size=False,
16 perceptual_weight_on_inputs=0.0,
17 ):
18 super().__init__()
19 self.scale_input_to_tgt_size = scale_input_to_tgt_size
20 self.scale_tgt_to_input_size = scale_tgt_to_input_size
21 self.init_decoder(decoder_config)
22 self.perceptual_loss = LPIPS().eval()
23 self.perceptual_weight = perceptual_weight
24 self.latent_weight = latent_weight
25 self.perceptual_weight_on_inputs = perceptual_weight_on_inputs
26
27 def init_decoder(self, config):
28 self.decoder = instantiate_from_config(config)

Callers

nothing calls this directly

Calls 2

init_decoderMethod · 0.95
LPIPSClass · 0.85

Tested by

no test coverage detected