Guest User

Untitled

a guest
Nov 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def createInputVec(z,x,y):
  2. r = math.sqrt(((x*scale-(img_size*scale/2))**2) + ((y*scale-(img_size*scale/2))**2) )
  3. z_size = len(z)
  4. input = torch.rand(1,z_size + 3)
  5.  
  6. for i in range(z_size):
  7. input[0][i] = z[i] * scale
  8.  
  9. input[0][z_size] = x * scale
  10. input[0][z_size+1] = y * scale
  11. input[0][z_size+2] = r
  12. input = Variable(input)
  13. return input
Add Comment
Please, Sign In to add comment