{"id":15663749,"url":"https://github.com/dnouri/noccn","last_synced_at":"2025-10-17T06:52:05.564Z","repository":{"id":141269949,"uuid":"10567246","full_name":"dnouri/noccn","owner":"dnouri","description":"Utilities for Alex Krizhevsky's cuda-convnet","archived":false,"fork":false,"pushed_at":"2013-12-16T22:18:24.000Z","size":160,"stargazers_count":17,"open_issues_count":4,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T01:51:11.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dnouri.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-08T10:32:29.000Z","updated_at":"2017-01-25T21:01:28.000Z","dependencies_parsed_at":"2023-03-13T10:34:34.097Z","dependency_job_id":null,"html_url":"https://github.com/dnouri/noccn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fnoccn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fnoccn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fnoccn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnouri%2Fnoccn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnouri","download_url":"https://codeload.github.com/dnouri/noccn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252748275,"owners_count":21798299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:39:44.087Z","updated_at":"2025-10-17T06:52:00.528Z","avatar_url":"https://github.com/dnouri.png","language":"Python","readme":"noccn is a collection of wrappers around Alex Krizhevsky's\n`cuda-convnet \u003chttp://code.google.com/p/cuda-convnet/\u003e`_.\n\nWhat is cuda-convnet?\n=====================\n\nAccording to its website, `cuda-convnet` is \"a fast C++/CUDA\nimplementation of convolutional (or more generally, feed-forward)\nneural networks. It can model arbitrary layer connectivity and network\ndepth. Any directed acyclic graph of layers will do. Training is done\nusing the back-propagation algorithm.\"\n\n`cuda-convnet` has really `nice docs on its homepage\n\u003chttp://code.google.com/p/cuda-convnet/\u003e`_.\n\nWhat is noccn for then?\n=======================\n\nnoccn helps you deal with cuda-convnet's many command-line parameters\nby allowing you to put them into a configuration file (usually\n`options.cfg`).  noccn also allows you to specify in your\nconfiguration file how you're building your data batches.  This way,\nyou'll easily remember how exactly you ran your experiments, and how\nyou got your results.\n\nThere is support for turning a list of folders containing images into\nbatches.  The batch creation code can be extended with your own batch\ncreator.\n\nnoccn is fairly stable -- I use it quite a lot -- but it's still\nunderdocumented.  A lot of the options will however just map to\ncuda-convnet's own.\n\nThe options.cfg file\n--------------------\n\nHere's an example of an `options.cfg` file::\n\n  #!ini\n  [DEFAULT]\n  data-provider = convdata.CIFARDataProvider\n  include = $HERE/../defaults.cfg\n\n  [train]\n  layer-def = $HERE/layers.cfg\n  layer-params = $HERE/layer-params.cfg\n  data-path = $HERE/../../batches/\n  train-range = 1-29\n  test-range = 30-40\n  save-path = $HERE/tmp\n  give-up-epochs = 200\n\n  [show]\n  test-range = 41-44\n\n  [predict-test]\n  train-range = 1\n  test-range = 30-40\n  report = 1\n\n  [predict-valid]\n  train-range = 1\n  test-range = 41-44\n  report = 1\n\n  [predict-train]\n  train-range = 1\n  test-range = 1-8\n  report = 1\n  # write-preds = $HERE/preds/preds-train.csv\n  # write-preds-cols = 1\n\n  [dataset]\n  input-path = $HERE/../../images/\n  pattern = *.jpg\n  output-path = $HERE/../../batches/\n\nThe path to this `options.cfg` file is the first argument to every\nscript in noccn.  `options.cfg` and arguments on the command-line can\nbe combined, where arguments on the command-line will overrule those\nin the config file.\n\nThe section ``[train]`` contains all the parameters for training\n(`ccn-train`).  Similarly, ``[show]`` has all the parameters for the\n`ccn-show` script and so on.  We can define multiple sections for the\n`ccn-predict` script.\n\nThe section ``[DEFAULT]`` defines variables that are used for all\nother sections.  The ``data-provider`` is a dotted path to the data\nprovider implementation that you want to use.  The default section may\nhave an ``include`` parameter to include shared parameters from\nanother file.\n\nInstallation in a virtualenv\n----------------------------\n\nUse `pip` to install `noccn` in a virtualenv::\n\n  #!shell\n  virtualenv noccn --system-site-packages\n  cd noccn\n  bin/pip install path/to/noccn\n\nIf you're on Debian or Ubuntu, you can install the required numpy and\nscipy like this::\n\n  #!shell\n   apt-get install python-numpy python-scipy\n\nScripts\n-------\n\nA few of the scripts included in noccn wrap those found in\n`cuda-convnet` itself.  These are `ccn-train` and `ccn-show`.  Scripts\nthat noccn itself adds are `ccn-predict` and `ccn-make-batches`.\n\nSome scripts require that you point them to a model snapshot or a\nsnapshot directory, using the `-f` argument.\n\nccn-train\n~~~~~~~~~\n\nUsing `ccn-train` is simple; just pass the path to the `options.cfg`\nfile as defined above::\n\n  #!shell\n  bin/ccn-train models/01/options.cfg\n\nnoccn's train script will only save a snapshot if there was an\nimprovement in the test score.  If you want to store snapshots\nregardless of whether or not the test score improved, you can pass\n`always-save = 1`.\n\nThe `convnet.give_up_epochs` argument defines after how many epochs\nwithout an improvement on the test score should we automatically stop\nthe learning.  This is useful if you want to run a few parameters\nunattended.\n\nccn-show\n~~~~~~~~\n\nDuring training, you can take a look at the network's performance, at\nrandom test samples and their predictions, and at the activations of\nthe first layer in your network using the `ccn-show` script::\n\n  #!shell\n  bin/ccn-show models/01/options.cfg -f models/01/tmp/ConvNet__*/\n\nIf you want to view a different convolutional layer, pass\ne.g. `--show-filters=conv2`.\n\nccn-predict\n~~~~~~~~~~~\n\nThe `ccn-predict` script prints out a classification report and a\nconfusion matrix.  This gives you numbers to evaluate your network's\nperformance::\n\n  #!shell\n  bin/ccn-predict models/01/options.cfg -f models/01/tmp/ConvNet__*/\n\nccn-make-batches\n~~~~~~~~~~~~~~~~\n\nThe `ccn-make-batches` script is a handy way to create input batches\nfor use with `cuda-convnet` from a folder with images.  Within the\nfolder that you point `ccn-make-batches` to (through the\nconfiguration's `[dataset]` section), you should have one folder per\ncategory, with JPEG images belonging to that category inside.  The way\n`ccn-make-batches` collects images can be configured through the\n`collector` argument (default:\n`noccn.dataset._collect_filenames_and_labels`).  The way input files\nare converted to data vectors can be overridden by passing in a\ndifferent `creator` (default: `noccn.dataset.BatchCreator`).\n\nAn example::\n\n  #!shell\n  bin/ccn-make-batches models/01/options.cfg\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnouri%2Fnoccn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnouri%2Fnoccn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnouri%2Fnoccn/lists"}