comparison nnet_ops.py @ 121:2ca8dccba270

debugging mlp.py
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Wed, 07 May 2008 16:08:18 -0400
parents 3ef569b92fba
children 1b06bc2c3ca9
comparison
equal deleted inserted replaced
120:5fa46297191b 121:2ca8dccba270
97 if x.type.ndim != 2 \ 97 if x.type.ndim != 2 \
98 or x.type.dtype not in ['float32', 'float64']: 98 or x.type.dtype not in ['float32', 'float64']:
99 raise ValueError('x must be 2-d tensor of floats') 99 raise ValueError('x must be 2-d tensor of floats')
100 if b.type.ndim != 1 \ 100 if b.type.ndim != 1 \
101 or x.type.dtype not in ['float32', 'float64']: 101 or x.type.dtype not in ['float32', 'float64']:
102 raise ValueError('x must be 1-d tensor of floats') 102 raise ValueError('b must be 1-d tensor of floats')
103 if y_idx.type.ndim != 1 \ 103 if y_idx.type.ndim != 1 \
104 or y_idx.type.dtype not in ['int32', 'int64']: 104 or y_idx.type.dtype not in ['int32', 'int64']:
105 raise ValueError('x must be 1-d tensor of ints') 105 raise ValueError('y_idx must be 1-d tensor of ints')
106 106
107 # TODO: Is this correct? It used to be y, not y_idx 107 # TODO: Is this correct? It used to be y, not y_idx
108 nll = tensor.Tensor(x.type.dtype, 108 nll = tensor.Tensor(x.type.dtype,
109 y_idx.type.broadcastable).make_result() 109 y_idx.type.broadcastable).make_result()
110 # nll = Tensor(x.dtype, y.broadcastable) 110 # nll = Tensor(x.dtype, y.broadcastable)