{
  "id": 6318,
  "title": "What data prep you all are doing?",
  "url": "/competitions/cifar-10/discussion/6318",
  "author_name": "",
  "post_date": "2013-11-15T16:59:12.807Z",
  "votes": null,
  "comment_count": 17,
  "views": 16482,
  "content": "<p>What type of data preprocessing you are trying?&nbsp;</p>\n<p>I just read the image and convert it from color to gray and then normalized the values to be in 0-1 range. &nbsp;Im trying to play around with this data and the results I'm getting are not that good, its giving ~ %39 accuracy.&nbsp;</p>\n<p>Would appreciate, if you could share more on the type prep you are using.&nbsp;</p>\n<p>Thanks in advance.</p>",
  "messages": [
    {
      "id": "33759",
      "postDate": "11/15/2013 16:59:12",
      "content": "<p>What type of data preprocessing you are trying?&nbsp;</p>\n<p>I just read the image and convert it from color to gray and then normalized the values to be in 0-1 range. &nbsp;Im trying to play around with this data and the results I'm getting are not that good, its giving ~ %39 accuracy.&nbsp;</p>\n<p>Would appreciate, if you could share more on the type prep you are using.&nbsp;</p>\n<p>Thanks in advance.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "35201",
      "postDate": "11/25/2013 17:18:49",
      "content": "<p>ZCA preprocessing is what I have been using - this is a standard technique used for images, with applications to other datasets with strong correlations between neighbouring points. Keeping the color information is very useful!</p>\n<p>My reference implementation is directly taken from&nbsp;<a href=\"http://arxiv.org/abs/1302.4389\">Maxout Networks</a> - see that paper for more details. There is a bigger, better implementation that was recently pushed in pylearn2, but I do not have the hardware to train it! I keep all my implementation work on Github <a href=\"https://github.com/kastnerkyle/kaggle-cifar10\">here</a></p>\n<p>Good luck!</p>\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "35247",
      "postDate": "11/26/2013 04:39:07",
      "content": "<p>@Kyle: Thanks for sharing your views. And thanks for sharing your code as well.&nbsp;</p>\n<p>ZCA is totally new to me. Will try it out and share my findings.&nbsp;</p>\n<p>&nbsp;</p>\n<p>Just my 2 cents. The other day, I found some papers wherein its mentioned that, for Images, unsupervised feature learning using KMeans, gives a good result[not sure if its as good as ZCA or Maxout]. I was thinking of something in that direction, but could not find any sample code to get started and got stuck. and I think KMeans will probably run comparatively faster than ZCA or Maxout, not fully sure though. The paper is available here:&nbsp;<a href=\"http://ai.stanford.edu/~ang/papers/nipsdlufl10-AnalysisSingleLayerUnsupervisedFeatureLearning.pdf\" target=\"_blank\">Unsupervised Feature Learning</a>&nbsp; and here: <a href=\"http://www.stanford.edu/~acoates/papers/coatesng_nntot2012.pdf\" target=\"_blank\">Unsupervised Feature Learning using KMeans</a>&nbsp;.</p>\n<p>I was looking at the examples of PyLearn2, but find it a bit difficult to catch up. Could you point me to some good tutorials or examples to get started on PyLearn2. Thanks in advance.&nbsp;</p>\n<p>&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "35294",
      "postDate": "11/26/2013 15:50:21",
      "content": "<p>From what I understand, KMeans is a decent preprocessing step, though not usually as good as ZCA, and also requires some very careful thought about initialization of clusters, how many there are, and how to deal with empty clusters. All very doable and the results would be cool to see. I used ZCA since it is fairly simple to implement, and many packages also have it built-in (I *think* scikit-learn even does, with PCA(whiten=True) - someone may correct me here).</p>\n<p>&nbsp;</p>\n<p>The best examples for pylearn2 can be found in the codebase from what I have seen, though it primarily uses the yaml scripting interface for the actual code. It can be found <a href=\"https://github.com/lisa-lab/pylearn2/tree/master/pylearn2/scripts/tutorials\">here</a> and also on nbviewer (<a href=\"http://nbviewer.ipython.org/urls/raw.github.com/lisa-lab/pylearn2/master/pylearn2/scripts/tutorials/convolutional_network.ipynb\">example</a>). Someday I may work up a tutorial on using the Python interface, but mostly the way to learn is to read the code and especially the existing files in the scripts/ directory.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "35899",
      "postDate": "12/06/2013 07:02:12",
      "content": "<p>hi, I'm a newcomer,nice to meet you here! I'm trying this work with matlab.but I &nbsp;haven't read the trainLabels.csv successfully. thanks for any good idea.' SOS'!!!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "36050",
      "postDate": "12/11/2013 07:17:57",
      "content": "<p>@pythonic - Is that 39% training set or cross validation set?&nbsp;</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "36361",
      "postDate": "12/19/2013 08:31:15",
      "content": "<p>@vignesh - It is the score I'm getting on cross validation, and when submitted to public leader-board.</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "36581",
      "postDate": "12/23/2013 16:06:46",
      "content": "<p>@deta: Might be a little late, but try csvimport.m (just download it from mathworks). It will hand you back a cell array, from which you can get the numerical values/strings via cell2mat() or cellstr().</p>\n<p>&nbsp;</p>\n<p>Regards</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "36675",
      "postDate": "12/26/2013 19:05:39",
      "content": "<p>Hi!</p>\n<p>we are two machine learning students that are using this dataset for improve our knowledge on this topic. Which features are you using for building the classifier? Are you using directly the RGB image or doing some kind of invariant descriptor transform? We are really noob and lost in computer vision.</p>\n<p>Thanks in advance!</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "52338",
      "postDate": "08/23/2014 08:06:58",
      "content": "<p>I am using Global Contrast Normalization and ZCA whitening for preprocessing.</p>\n<p>My implementation&nbsp; can be found at&nbsp;https://github.com/nagadomi/kaggle-cifar10-torch7</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "53287",
      "postDate": "09/07/2014 15:08:23",
      "content": "<p>thanks nagadomi, really hepfull your hint ,&nbsp;&nbsp;&nbsp; i&nbsp; dive deeper on it and i found another great course from the Pr. Andrew Ng.&nbsp; here is the link : http://ufldl.stanford.edu/wiki/index.php/UFLDL_Tutorial</p>\n<p>those who want to learn more about ZCA should take a look&nbsp; at the section :&nbsp; Preprocessing: PCA and ZCA Whitening</p>",
      "rawMarkdown": "",
      "votes": null
    },
    {
      "id": "86181",
      "postDate": "07/20/2015 19:06:20",
      "content": "<p>Anyone have a python snippet code of ZCA ? </p>",
      "rawMarkdown": "Anyone have a python snippet code of ZCA ?",
      "votes": null
    },
    {
      "id": "86182",
      "postDate": "07/20/2015 19:25:50",
      "content": "<p>I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core</p>\n\n<p><a href=\"https://gist.github.com/kastnerkyle/9822570\">https://gist.github.com/kastnerkyle/9822570</a></p>",
      "rawMarkdown": "I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core\r\n\r\nhttps://gist.github.com/kastnerkyle/9822570",
      "votes": null
    },
    {
      "id": "86185",
      "postDate": "07/20/2015 19:29:24",
      "content": "<p>[quote=Kyle Kastner;86182]</p>\n\n<p>I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core</p>\n\n<p><a href=\"https://gist.github.com/kastnerkyle/9822570\">https://gist.github.com/kastnerkyle/9822570</a></p>\n\n<p>[/quote]</p>\n\n<p>You meant this class, correct?\nHow do you actually use it?\nI saw a topic where the method required a 2d matrix as input... </p>\n\n<pre><code>class ZCA(BaseEstimator, TransformerMixin):\n&quot;&quot;&quot;\nIdentical to CovZCA up to scaling due to lack of division by n_samples\nS ** 2 / n_samples should correct this but components_ come out different\nthough transformed examples are identical.\n&quot;&quot;&quot;\ndef __init__(self, n_components=None, bias=.1, copy=True):\n    self.n_components = n_components\n    self.bias = bias\n    self.copy = copy\n\ndef fit(self, X, y=None):\n    if self.copy:\n        X = np.array(X, copy=self.copy)\n    n_samples, n_features = X.shape\n    self.mean_ = np.mean(X, axis=0)\n    X -= self.mean_\n    U, S, VT = svd(X, full_matrices=False)\n    components = np.dot(VT.T * np.sqrt(1.0 / (S ** 2 + self.bias)), VT)\n    self.components_ = components[:self.n_components]\n    return self\n\ndef transform(self, X):\n    if self.copy:\n        X = np.array(X, copy=self.copy)\n        X = np.copy(X)\n    X -= self.mean_\n    X_transformed = np.dot(X, self.components_.T)\n    return X_transformed\n</code></pre>",
      "rawMarkdown": "[quote=Kyle Kastner;86182]\r\n\r\nI have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core\r\n\r\nhttps://gist.github.com/kastnerkyle/9822570\r\n\r\n[/quote]\r\n\r\nYou meant this class, correct?\r\nHow do you actually use it?\r\nI saw a topic where the method required a 2d matrix as input... \r\n\r\n    class ZCA(BaseEstimator, TransformerMixin):\r\n    \"\"\"\r\n    Identical to CovZCA up to scaling due to lack of division by n_samples\r\n    S ** 2 / n_samples should correct this but components_ come out different\r\n    though transformed examples are identical.\r\n    \"\"\"\r\n    def __init__(self, n_components=None, bias=.1, copy=True):\r\n        self.n_components = n_components\r\n        self.bias = bias\r\n        self.copy = copy\r\n \r\n    def fit(self, X, y=None):\r\n        if self.copy:\r\n            X = np.array(X, copy=self.copy)\r\n        n_samples, n_features = X.shape\r\n        self.mean_ = np.mean(X, axis=0)\r\n        X -= self.mean_\r\n        U, S, VT = svd(X, full_matrices=False)\r\n        components = np.dot(VT.T * np.sqrt(1.0 / (S ** 2 + self.bias)), VT)\r\n        self.components_ = components[:self.n_components]\r\n        return self\r\n \r\n    def transform(self, X):\r\n        if self.copy:\r\n            X = np.array(X, copy=self.copy)\r\n            X = np.copy(X)\r\n        X -= self.mean_\r\n        X_transformed = np.dot(X, self.components_.T)\r\n        return X_transformed",
      "votes": null
    },
    {
      "id": "86189",
      "postDate": "07/20/2015 19:39:24",
      "content": "<p>Yes, for 2D input, you take the images and flatten them from 32x32x3 to 3072, then you have a big huge matrix of n_images x 3072. This is what ZCA takes in. Then afterwards if you want you can reshape the transformed versions back and view them.</p>\n\n<p>For more information, check out Alex Krizhevsky's 2009 thesis <a href=\"http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf\">http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf</a> . He goes into some depth about ZCA, why it is useful at least for CIFAR10, and how it works.</p>",
      "rawMarkdown": "Yes, for 2D input, you take the images and flatten them from 32x32x3 to 3072, then you have a big huge matrix of n_images x 3072. This is what ZCA takes in. Then afterwards if you want you can reshape the transformed versions back and view them.\r\n\r\nFor more information, check out Alex Krizhevsky's 2009 thesis http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf . He goes into some depth about ZCA, why it is useful at least for CIFAR10, and how it works.",
      "votes": null
    },
    {
      "id": "92049",
      "postDate": "09/10/2015 23:24:23",
      "content": "<p>Does Global Contrast normalization also useful when i convert the output to black and white? Or it makes no sense?</p>",
      "rawMarkdown": "Does Global Contrast normalization also useful when i convert the output to black and white? Or it makes no sense?",
      "votes": null
    },
    {
      "id": "101494",
      "postDate": "12/15/2015 16:06:19",
      "content": "<p>I'm using this dataset for object recognition using max pooling CNN. What are the preprocessing required for that? Is it better to do with color images or go for greay scale images ?  </p>",
      "rawMarkdown": "I'm using this dataset for object recognition using max pooling CNN. What are the preprocessing required for that? Is it better to do with color images or go for greay scale images ?",
      "votes": null
    },
    {
      "id": "811792",
      "postDate": "04/18/2020 08:30:08",
      "content": "<p>Can I apply data augmentation in cifar-10 dataset? If so, what is the process? </p>",
      "rawMarkdown": "Can I apply data augmentation in cifar-10 dataset? If so, what is the process?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 35201,
      "author_name": "kastnerkyle",
      "author_url": "",
      "post_date": "11/25/2013 17:18:49",
      "content": "<p>ZCA preprocessing is what I have been using - this is a standard technique used for images, with applications to other datasets with strong correlations between neighbouring points. Keeping the color information is very useful!</p>\n<p>My reference implementation is directly taken from&nbsp;<a href=\"http://arxiv.org/abs/1302.4389\">Maxout Networks</a> - see that paper for more details. There is a bigger, better implementation that was recently pushed in pylearn2, but I do not have the hardware to train it! I keep all my implementation work on Github <a href=\"https://github.com/kastnerkyle/kaggle-cifar10\">here</a></p>\n<p>Good luck!</p>\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 35247,
      "author_name": "pythonomic",
      "author_url": "",
      "post_date": "11/26/2013 04:39:07",
      "content": "<p>@Kyle: Thanks for sharing your views. And thanks for sharing your code as well.&nbsp;</p>\n<p>ZCA is totally new to me. Will try it out and share my findings.&nbsp;</p>\n<p>&nbsp;</p>\n<p>Just my 2 cents. The other day, I found some papers wherein its mentioned that, for Images, unsupervised feature learning using KMeans, gives a good result[not sure if its as good as ZCA or Maxout]. I was thinking of something in that direction, but could not find any sample code to get started and got stuck. and I think KMeans will probably run comparatively faster than ZCA or Maxout, not fully sure though. The paper is available here:&nbsp;<a href=\"http://ai.stanford.edu/~ang/papers/nipsdlufl10-AnalysisSingleLayerUnsupervisedFeatureLearning.pdf\" target=\"_blank\">Unsupervised Feature Learning</a>&nbsp; and here: <a href=\"http://www.stanford.edu/~acoates/papers/coatesng_nntot2012.pdf\" target=\"_blank\">Unsupervised Feature Learning using KMeans</a>&nbsp;.</p>\n<p>I was looking at the examples of PyLearn2, but find it a bit difficult to catch up. Could you point me to some good tutorials or examples to get started on PyLearn2. Thanks in advance.&nbsp;</p>\n<p>&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 35294,
      "author_name": "kastnerkyle",
      "author_url": "",
      "post_date": "11/26/2013 15:50:21",
      "content": "<p>From what I understand, KMeans is a decent preprocessing step, though not usually as good as ZCA, and also requires some very careful thought about initialization of clusters, how many there are, and how to deal with empty clusters. All very doable and the results would be cool to see. I used ZCA since it is fairly simple to implement, and many packages also have it built-in (I *think* scikit-learn even does, with PCA(whiten=True) - someone may correct me here).</p>\n<p>&nbsp;</p>\n<p>The best examples for pylearn2 can be found in the codebase from what I have seen, though it primarily uses the yaml scripting interface for the actual code. It can be found <a href=\"https://github.com/lisa-lab/pylearn2/tree/master/pylearn2/scripts/tutorials\">here</a> and also on nbviewer (<a href=\"http://nbviewer.ipython.org/urls/raw.github.com/lisa-lab/pylearn2/master/pylearn2/scripts/tutorials/convolutional_network.ipynb\">example</a>). Someday I may work up a tutorial on using the Python interface, but mostly the way to learn is to read the code and especially the existing files in the scripts/ directory.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 35899,
      "author_name": "deta146595",
      "author_url": "",
      "post_date": "12/06/2013 07:02:12",
      "content": "<p>hi, I'm a newcomer,nice to meet you here! I'm trying this work with matlab.but I &nbsp;haven't read the trainLabels.csv successfully. thanks for any good idea.' SOS'!!!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 36050,
      "author_name": "vignesh0",
      "author_url": "",
      "post_date": "12/11/2013 07:17:57",
      "content": "<p>@pythonic - Is that 39% training set or cross validation set?&nbsp;</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 36361,
      "author_name": "pythonomic",
      "author_url": "",
      "post_date": "12/19/2013 08:31:15",
      "content": "<p>@vignesh - It is the score I'm getting on cross validation, and when submitted to public leader-board.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 36581,
      "author_name": "planckton",
      "author_url": "",
      "post_date": "12/23/2013 16:06:46",
      "content": "<p>@deta: Might be a little late, but try csvimport.m (just download it from mathworks). It will hand you back a cell array, from which you can get the numerical values/strings via cell2mat() or cellstr().</p>\n<p>&nbsp;</p>\n<p>Regards</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 36675,
      "author_name": "barrososarasua",
      "author_url": "",
      "post_date": "12/26/2013 19:05:39",
      "content": "<p>Hi!</p>\n<p>we are two machine learning students that are using this dataset for improve our knowledge on this topic. Which features are you using for building the classifier? Are you using directly the RGB image or doing some kind of invariant descriptor transform? We are really noob and lost in computer vision.</p>\n<p>Thanks in advance!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 52338,
      "author_name": "nagadomi",
      "author_url": "",
      "post_date": "08/23/2014 08:06:58",
      "content": "<p>I am using Global Contrast Normalization and ZCA whitening for preprocessing.</p>\n<p>My implementation&nbsp; can be found at&nbsp;https://github.com/nagadomi/kaggle-cifar10-torch7</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 53287,
      "author_name": "juniorteudjio",
      "author_url": "",
      "post_date": "09/07/2014 15:08:23",
      "content": "<p>thanks nagadomi, really hepfull your hint ,&nbsp;&nbsp;&nbsp; i&nbsp; dive deeper on it and i found another great course from the Pr. Andrew Ng.&nbsp; here is the link : http://ufldl.stanford.edu/wiki/index.php/UFLDL_Tutorial</p>\n<p>those who want to learn more about ZCA should take a look&nbsp; at the section :&nbsp; Preprocessing: PCA and ZCA Whitening</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 86181,
      "author_name": "andrelopes1705",
      "author_url": "",
      "post_date": "07/20/2015 19:06:20",
      "content": "<p>Anyone have a python snippet code of ZCA ? </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 86182,
      "author_name": "kastnerkyle",
      "author_url": "",
      "post_date": "07/20/2015 19:25:50",
      "content": "<p>I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core</p>\n\n<p><a href=\"https://gist.github.com/kastnerkyle/9822570\">https://gist.github.com/kastnerkyle/9822570</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 86185,
      "author_name": "andrelopes1705",
      "author_url": "",
      "post_date": "07/20/2015 19:29:24",
      "content": "<p>[quote=Kyle Kastner;86182]</p>\n\n<p>I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core</p>\n\n<p><a href=\"https://gist.github.com/kastnerkyle/9822570\">https://gist.github.com/kastnerkyle/9822570</a></p>\n\n<p>[/quote]</p>\n\n<p>You meant this class, correct?\nHow do you actually use it?\nI saw a topic where the method required a 2d matrix as input... </p>\n\n<pre><code>class ZCA(BaseEstimator, TransformerMixin):\n&quot;&quot;&quot;\nIdentical to CovZCA up to scaling due to lack of division by n_samples\nS ** 2 / n_samples should correct this but components_ come out different\nthough transformed examples are identical.\n&quot;&quot;&quot;\ndef __init__(self, n_components=None, bias=.1, copy=True):\n    self.n_components = n_components\n    self.bias = bias\n    self.copy = copy\n\ndef fit(self, X, y=None):\n    if self.copy:\n        X = np.array(X, copy=self.copy)\n    n_samples, n_features = X.shape\n    self.mean_ = np.mean(X, axis=0)\n    X -= self.mean_\n    U, S, VT = svd(X, full_matrices=False)\n    components = np.dot(VT.T * np.sqrt(1.0 / (S ** 2 + self.bias)), VT)\n    self.components_ = components[:self.n_components]\n    return self\n\ndef transform(self, X):\n    if self.copy:\n        X = np.array(X, copy=self.copy)\n        X = np.copy(X)\n    X -= self.mean_\n    X_transformed = np.dot(X, self.components_.T)\n    return X_transformed\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 86189,
      "author_name": "kastnerkyle",
      "author_url": "",
      "post_date": "07/20/2015 19:39:24",
      "content": "<p>Yes, for 2D input, you take the images and flatten them from 32x32x3 to 3072, then you have a big huge matrix of n_images x 3072. This is what ZCA takes in. Then afterwards if you want you can reshape the transformed versions back and view them.</p>\n\n<p>For more information, check out Alex Krizhevsky's 2009 thesis <a href=\"http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf\">http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf</a> . He goes into some depth about ZCA, why it is useful at least for CIFAR10, and how it works.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 92049,
      "author_name": "andrelopes1705",
      "author_url": "",
      "post_date": "09/10/2015 23:24:23",
      "content": "<p>Does Global Contrast normalization also useful when i convert the output to black and white? Or it makes no sense?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 101494,
      "author_name": "sathyank",
      "author_url": "",
      "post_date": "12/15/2015 16:06:19",
      "content": "<p>I'm using this dataset for object recognition using max pooling CNN. What are the preprocessing required for that? Is it better to do with color images or go for greay scale images ?  </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 811792,
      "author_name": "tanvirchy",
      "author_url": "",
      "post_date": "04/18/2020 08:30:08",
      "content": "<p>Can I apply data augmentation in cifar-10 dataset? If so, what is the process? </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "33759": "",
    "35201": "",
    "35247": "",
    "35294": "",
    "35899": "",
    "36050": "",
    "36361": "",
    "36581": "",
    "36675": "",
    "52338": "",
    "53287": "",
    "86181": "Anyone have a python snippet code of ZCA ?",
    "86182": "I have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core\r\n\r\nhttps://gist.github.com/kastnerkyle/9822570",
    "86185": "[quote=Kyle Kastner;86182]\r\n\r\nI have some work here - the ZCA object is the only one I can really comment on though. The rest are just experiments for out of core\r\n\r\nhttps://gist.github.com/kastnerkyle/9822570\r\n\r\n[/quote]\r\n\r\nYou meant this class, correct?\r\nHow do you actually use it?\r\nI saw a topic where the method required a 2d matrix as input... \r\n\r\n    class ZCA(BaseEstimator, TransformerMixin):\r\n    \"\"\"\r\n    Identical to CovZCA up to scaling due to lack of division by n_samples\r\n    S ** 2 / n_samples should correct this but components_ come out different\r\n    though transformed examples are identical.\r\n    \"\"\"\r\n    def __init__(self, n_components=None, bias=.1, copy=True):\r\n        self.n_components = n_components\r\n        self.bias = bias\r\n        self.copy = copy\r\n \r\n    def fit(self, X, y=None):\r\n        if self.copy:\r\n            X = np.array(X, copy=self.copy)\r\n        n_samples, n_features = X.shape\r\n        self.mean_ = np.mean(X, axis=0)\r\n        X -= self.mean_\r\n        U, S, VT = svd(X, full_matrices=False)\r\n        components = np.dot(VT.T * np.sqrt(1.0 / (S ** 2 + self.bias)), VT)\r\n        self.components_ = components[:self.n_components]\r\n        return self\r\n \r\n    def transform(self, X):\r\n        if self.copy:\r\n            X = np.array(X, copy=self.copy)\r\n            X = np.copy(X)\r\n        X -= self.mean_\r\n        X_transformed = np.dot(X, self.components_.T)\r\n        return X_transformed",
    "86189": "Yes, for 2D input, you take the images and flatten them from 32x32x3 to 3072, then you have a big huge matrix of n_images x 3072. This is what ZCA takes in. Then afterwards if you want you can reshape the transformed versions back and view them.\r\n\r\nFor more information, check out Alex Krizhevsky's 2009 thesis http://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf . He goes into some depth about ZCA, why it is useful at least for CIFAR10, and how it works.",
    "92049": "Does Global Contrast normalization also useful when i convert the output to black and white? Or it makes no sense?",
    "101494": "I'm using this dataset for object recognition using max pooling CNN. What are the preprocessing required for that? Is it better to do with color images or go for greay scale images ?",
    "811792": "Can I apply data augmentation in cifar-10 dataset? If so, what is the process?"
  },
  "source": "meta"
}