def test_rgb_yuv():
 rng = np.random.RandomState([1, 2, 3])
 X = as_floatX(rng.randn(5, ((32 * 32) * 3)))
 axes = ['b', 0, 1, 'c']
 view_converter = dense_design_matrix.DefaultViewConverter((32, 32, 3), axes)
 dataset = DenseDesignMatrix(X=X, view_converter=view_converter)
 dataset.axes = axes
 preprocessor = RGB_YUV()
 dataset.apply_preprocessor(preprocessor)
 result = dataset.get_design_matrix()
 assert isfinite(result)

def test_rgb_yuv ( ) : rng = np . random . RandomState ( [ 1 , 2 , 3 ] ) X = as_floatX ( rng . randn ( 5 , ( ( 32 * 32 ) * 3 ) ) ) axes = [ 'b' , 0 , 1 , 'c' ] view_converter = dense_design_matrix . DefaultViewConverter ( ( 32 , 32 , 3 ) , axes ) dataset = DenseDesignMatrix ( X = X , view_converter = view_converter ) dataset . axes = axes preprocessor = RGB_YUV ( ) dataset . apply_preprocessor ( preprocessor ) result = dataset . get_design_matrix ( ) assert isfinite ( result )
test on a random image if the per-processor loads and works without anyerror and doesnt result in any nan or inf values .