view pylearn/datasets/test_tzanetakis.py @ 1479:1b69d435f09f

fix error string.
author Frederic Bastien <nouiz@nouiz.org>
date Wed, 25 May 2011 09:26:47 -0400
parents b39a9f02ef01
children
line wrap: on
line source

import theano

from pylearn.io import wavread
from pylearn.datasets import tzanetakis

def test_tzanetakis():
    idx = theano.tensor.lscalar()

    tz_ex = tzanetakis.TzanetakisExample()
    path, label = tz_ex(idx)
    print path, label

    f = theano.function([idx], [path, label])

    return

    ### The code below does not run, because of
    # TypeError: object of type 'TzanetakisExample' has no len()
    #
    # Someone should fix it if they want to finish the test! For now, it is
    # just disabled (since the function returns above).

    for i in xrange(len(tz_ex)):
        print i, f(i)

    wav,sr = wavread.wav_read_int16(path)

    f = theano.function([idx], wav)
    for i in xrange(len(tz_ex)):
        print i, f(i).shape