mila-iqia / blocks-examples

Examples and scripts using Blocks
MIT License
147 stars 94 forks source link

BatchNormalizedMLP problem with more than two dimensions #109

Open rrahmati opened 7 years ago

rrahmati commented 7 years ago

It seems that if we pass a 3D tensor (e.g. time added as the first dimension) to the BatchNormalizedMLP, we get the following error. Reshaping the input and output to 2D tensors will solve the problem.

TypeError: ('An update must have the same type as the original shared variable (shared_var=population_mean, shared_var.type=CudaNdarrayType(float32, vector), update_val=Elemwise{add,no_inplace}.0, update_val.type=TensorType(float32, matrix))., If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.\n\nOriginal exception:\n\tTypeError: An update must have the same type as the original shared variable (shared_var=population_mean, shared_var.type=CudaNdarrayType(float32, vector), update_val=Elemwise{add,no_inplace}.0, update_val.type=TensorType(float32, matrix))., If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.', 'If the difference is related to the broadcast pattern, you can call the tensor.unbroadcast(var, axis_to_unbroadcast[, ...]) function to remove broadcastable dimensions.')