Git Product home page Git Product logo

Comments (5)

JoshRosen avatar JoshRosen commented on September 26, 2024

I tried comparing the image-at-a-time predictions to the batch predictions computed when constructing the model stats DB, but they appear to be the same:

@@ -107,6 +116,8 @@ def predict_for_image(checkpoint, imagenum):
     """
     features = run_model_on_corpus_image(checkpoint, imagenum, ["probs_cudanet_out"])
     class_number_probs = enumerate(features["probs_cudanet_out"][0])
+    print features["probs_cudanet_out"][0]
+    print get_model_stats_db().get_stats(checkpoint).probs_by_image[imagenum]
     corpus = get_image_corpus()
     class_label_probs = [{'class': corpus.label_names[l], 'prob': float(p)} for (l, p) in class_number_probs]
     return jsonify({'predictions': class_label_probs})

Example output:

[ 0.54554266  0.01066636  0.21200019  0.04830068  0.01019327  0.08629041
  0.00186147  0.00217843  0.07170548  0.01126096]
[ 0.54554272  0.01066636  0.21200007  0.04830074  0.01019327  0.08629046
  0.00186147  0.00217843  0.07170548  0.01126096] 

from deepviz.

JoshRosen avatar JoshRosen commented on September 26, 2024

It looks like cuda-convnet subtracts the data mean when loading images using its CIFARDataProvider. Decaf's imgs_cudaconv_to_decaf performs reshaping, but I think we still need to subtract the mean ourselves:

>>> cdp = CIFARDataProvider("/Users/joshrosen/Documents/visualization_class/deepViz/cifar-10-py-colmajor", [1, 1])
>>> cdp.data_dic[0]['data']
array([[ -75.45458984,   19.54541016,  120.54541016, ...,  -63.45458984,
         115.54541016,  -72.45458984],
       [ -91.22865295,   -8.22865295,  118.77134705, ...,  -74.22865295,
         119.77134705,  -73.22865295],
       [ -84.84976196,  -29.84976196,  118.15023804, ...,  -60.84976196,
          76.15023804,  -74.84976196],
       ...,
       [  24.90582275,   23.90582275,  -32.09417725, ...,  -47.09417725,
          99.90582275,   14.90582275],
       [ -31.32595062,   26.67404938,  -32.32595062, ...,  -46.32595062,
         139.67404175,   14.67404938],
       [ -43.7903595 ,   28.2096405 ,  -31.7903595 , ...,  -47.7903595 ,
         138.2096405 ,   15.2096405 ]], dtype=float32)
>>> batch = cPickle.load(open("/Users/joshrosen/Documents/visualization_class/deepViz/cifar-10-py-colmajor/data_batch_1"))
>>> image_data = batch['data']
>>> converted = conversions.imgs_cudaconv_to_decaf(image_data.T, 32, 3)
>>> converted[0]
array([[[ 59,  62,  63],
        [ 43,  46,  45],
        [ 50,  48,  43],
        ...,
        [158, 132, 108],
        [152, 125, 102],
        [148, 124, 103]],
>>> data_mean = cPickle.load(open("/Users/joshrosen/Documents/visualization_class/deepViz/cifar-10-py-colmajor/batches.meta"))['data_mean']
>>> data_mean
array([[ 134.45458984],
       [ 134.22865295],
       [ 134.84976196],
       ...,
       [ 115.09417725],
       [ 115.32595062],
       [ 115.7903595 ]], dtype=float32)
>>> import numpy as np
>>> reshaped_data_mean = conversions.imgs_cudaconv_to_decaf(np.array([data_mean]), 32, 3)
>>> (converted - reshaped_data_mean)[0]
array([[[ -75.45458984,  -72.60449219,  -67.32525635],
        [ -91.22865295,  -88.21459961,  -84.74975586],
        [ -84.84976196,  -86.70948792,  -87.09373474],
        ...,
        [  22.61062622,   -3.22415161,  -22.48239136],
        [  17.06632996,   -9.87303162,  -28.27662659],
        [  13.49519348,  -10.54611206,  -27.13848877]],
....

from deepviz.

JoshRosen avatar JoshRosen commented on September 26, 2024

There was also an off-by-one error in the front-end's redraw logic when switching tabs (0 vs. 1-based indexing for checkpoint numbers). After fixing this, we see a very good confusion matrix with entries that make sense. Pushing the fix in a few minutes.

from deepviz.

etrain avatar etrain commented on September 26, 2024

Nice catch! We'll see if this helps the clusters.

On Thu, Dec 12, 2013 at 5:33 PM, Josh Rosen [email protected]:

Closed #19 #19 via 11825cchttps://github.com/bruckner/deepViz/commit/11825cc6adf4edbd171c6904953da494540ffd35
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/19
.

from deepviz.

JoshRosen avatar JoshRosen commented on September 26, 2024

Here's the final confusion matrix after my latest commit:

image

from deepviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.