Skip to content

Commit

Permalink
Merge pull request #104 from JanRocketMan/ppl_fix
Browse files Browse the repository at this point in the history
Add path endpoints option for Perceptual Path Length computation
  • Loading branch information
rosinality authored Aug 24, 2020
2 parents b7e6004 + f06af49 commit d1ef862
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ppl.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def lerp(a, b, t):
parser.add_argument('--size', type=int, default=256)
parser.add_argument('--eps', type=float, default=1e-4)
parser.add_argument('--crop', action='store_true')
parser.add_argument('--sampling', default='end', choices=['end', 'full'])
parser.add_argument('ckpt', metavar='CHECKPOINT')

args = parser.parse_args()
Expand Down Expand Up @@ -66,7 +67,10 @@ def lerp(a, b, t):
noise = g.make_noise()

inputs = torch.randn([batch * 2, latent_dim], device=device)
lerp_t = torch.rand(batch, device=device)
if args.sampling == 'full':
lerp_t = torch.rand(batch, device=device)
else:
lerp_t = torch.zeros(batch, device=device)

if args.space == 'w':
latent = g.get_latent(inputs)
Expand Down

0 comments on commit d1ef862

Please sign in to comment.