Spaces:
Runtime error
Runtime error
Faran Fahandezh commited on
Commit ·
3c5efcb
1
Parent(s): 044e99f
Add application file4
Browse filesFiles changed (2)
897 unmodified lines898899900901901902903904905897 unmodified lines bin_target = bin_target * 256 #-> [0, 256] bin_target = dec2bin(bin_target.permute([0,2,1]).round().int(), 8) bin_target = bin_target.reshape([target.shape[0], target.shape[2], 16]).permute([0,2,1]) t_weights = (t<10).cuda().unsqueeze(1).unsqueeze(2) # t_weights = (t<10).cuda().unsqueeze(1).unsqueeze(2) t_weights = (t<10).unsqueeze(1).unsqueeze(2) t_weights = t_weights * (t_weights.shape[0]/max(1, t_weights.sum())) bin_target[bin_target==0] = -1 assert model_output_bin.shape == bin_target.shape76 unmodified lines7778798080818283148 unmodified lines2322332342352362352362372382397 unmodified lines24724824925025025125225376 unmodified lines q = q.transpose(1,2) v = v.transpose(1,2)# calculate attention using function we will define next #TODO mask = mask.to('cuda:0') # mask = mask.to('cuda:0') scores = attention(q, k, v, self.d_k, mask, self.dropout) # concatenate heads and put through final linear layer concat = scores.transpose(1,2).contiguous().view(bs, -1, self.d_model)148 unmodified lines
# Different input embeddings (Input, Time, Conditions) #TODO--------------------------------------------------------------- x = x.to('cuda:0') timesteps = timesteps.to(x.device) # x = x.to('cuda:0') # timesteps = timesteps.to(x.device) # print(x.device)
time_emb = self.time_embed(timestep_embedding(timesteps, self.model_channels))7 unmodified lines else: cond = th.cat((cond, kwargs[key]), 2) #TODO cond = cond.to('cuda:0') # cond = cond.to('cuda:0') cond_emb = self.condition_emb(cond.float())
# PositionalEncoding and DM modelhouse_diffusion/gaussian_diffusion.py+2-1
house_diffusion/transformer.py+4-4