shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

some of LMNN notebook cells fails #1687

Closed vigsterkr closed 11 years ago

vigsterkr commented 11 years ago

any ideas?

running /home/buildslave/nightly_default/build/doc/ipython-notebooks/metric/LMNN.ipynb
Failed to run cell:
from modshogun import LMNN

# number of targer neighbours in LMNN, here we just use the same value that was used for KNN before
k = 3
lmnn = LMNN(ape_features, ape_labels, k)
lmnn.set_diagonal(True)
lmnn.set_maxiter(1200)
init_transform = numpy.eye(ape_features.get_num_features())
lmnn.train(init_transform)

diagonal = numpy.diag(lmnn.get_linear_transform())
print('%d out of %d elements are non-zero.' % (numpy.sum(diagonal != 0), diagonal.size))

Failed to run cell:
import matplotlib.pyplot as pyplot
%matplotlib inline

statistics = lmnn.get_statistics()
pyplot.plot(statistics.obj.get())
pyplot.grid(True)
pyplot.xlabel('Number of iterations')
pyplot.ylabel('LMNN objective')
pyplot.show()

Failed to run cell:
from modshogun import CSVFile, RealFeatures, MulticlassLabels

wine_features = RealFeatures(CSVFile('../../../data/multiclass/fm_wine.dat'))
wine_labels = MulticlassLabels(CSVFile('../../../data/multiclass/label_wine.dat'))

assert(wine_features.get_num_vectors() == wine_labels.get_num_labels())
print('%d feature vectors with %d features from %d different classes.' % (wine_features.get_num_vectors(), \
       wine_features.get_num_features(), wine_labels.get_num_classes()))

      3 cells failed to complete
     25 code cells from notebook 
wrote /home/shogun/static/notebook/LMNN.ipynb
sonney2k commented 11 years ago

I think they just take too long... - this cell ran for ~50mins cpu time before the timeout killed it

sonney2k commented 11 years ago

maybe you just take a subset or converge early or can you speed it up further ?

iglesias commented 11 years ago

I will have a look at it during the weekend. I think I will probably go for using less dimensions.

vigsterkr commented 11 years ago

currently only one is failing

running /home/buildslave/nightly_default/build/doc/ipython-notebooks/metric/LMNN.ipynb
Failed to run cell:
from modshogun import LMNN

# number of targer neighbours in LMNN, here we just use the same value that was used for KNN before
k = 3
lmnn = LMNN(ape_features, ape_labels, k)
lmnn.set_diagonal(True)
lmnn.set_maxiter(1200)
init_transform = numpy.eye(ape_features.get_num_features())
lmnn.train(init_transform)

diagonal = numpy.diag(lmnn.get_linear_transform())
print('%d out of %d elements are non-zero.' % (numpy.sum(diagonal != 0), diagonal.size))

      1 cells failed to complete
     25 code cells from notebook 
sonney2k commented 11 years ago

it is too slow anyways - slower than FGM (eating > 90mins of CPU before being killed)

vigsterkr commented 11 years ago

90 mins??? the last time it was running successfully was 25m1.033s

sonney2k commented 11 years ago

Look closely:

http://buildbot.shogun-toolbox.org/builders/nightly_default/builds/554/steps/notebooks/logs/stdio

123mins CPU time!

iglesias commented 11 years ago

All right, I am updating it to use less number of features right away. On 29 Sep 2013 22:31, "Soeren Sonnenburg" notifications@github.com wrote:

Look closely:

http://buildbot.shogun-toolbox.org/builders/nightly_default/builds/554/steps/notebooks/logs/stdio

123mins CPU time!

— Reply to this email directly or view it on GitHubhttps://github.com/shogun-toolbox/shogun/issues/1687#issuecomment-25328529 .

iglesias commented 11 years ago

Updated in #1698

iglesias commented 11 years ago

@sonney2k, shall we rebuild and see if it behaves better now? This time took about 15 seconds in my computer.

sonney2k commented 11 years ago

@iglesias it took 2m16s now so it is OK.

iglesias commented 11 years ago

@sonney2k great to know, thanks!