Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. height = 1 + (self.input_dim_1 - pool_size) / 2
  2. width = 1 + (self.input_dim_2 - pool_size) / 2
  3.  
  4. output = np.zeros(inputs.shape[0], inputs.shape[1], height, width)
  5.  
  6. for i in range(inputs.shape[0]):
  7. for j in range(inputs.shape[1]):
  8. for k in range(0,inputs.shape[2],2):
  9. for l in range(0, inputs.shape[3], 2):
  10. output[i,j,k/2,l/2] = np.max(inputs[i,j,k:k+pool_size, l:l+pool_size])
  11.  
  12. return output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement