Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- height = 1 + (self.input_dim_1 - pool_size) / 2
- width = 1 + (self.input_dim_2 - pool_size) / 2
- output = np.zeros(inputs.shape[0], inputs.shape[1], height, width)
- for i in range(inputs.shape[0]):
- for j in range(inputs.shape[1]):
- for k in range(0,inputs.shape[2],2):
- for l in range(0, inputs.shape[3], 2):
- output[i,j,k/2,l/2] = np.max(inputs[i,j,k:k+pool_size, l:l+pool_size])
- return output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement