{"id":13395865,"url":"https://github.com/davidinouye/destructive-deep-learning","last_synced_at":"2026-04-08T15:31:07.852Z","repository":{"id":62567192,"uuid":"136948292","full_name":"davidinouye/destructive-deep-learning","owner":"davidinouye","description":"Destructive deep learning estimators and functions that are compatible with scikit-learn.","archived":false,"fork":false,"pushed_at":"2020-10-04T09:06:40.000Z","size":4191,"stargazers_count":18,"open_issues_count":16,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-08T19:30:20.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidinouye.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-11T15:51:16.000Z","updated_at":"2024-11-28T08:33:38.000Z","dependencies_parsed_at":"2022-11-03T18:55:41.522Z","dependency_job_id":null,"html_url":"https://github.com/davidinouye/destructive-deep-learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidinouye/destructive-deep-learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidinouye%2Fdestructive-deep-learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidinouye%2Fdestructive-deep-learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidinouye%2Fdestructive-deep-learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidinouye%2Fdestructive-deep-learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidinouye","download_url":"https://codeload.github.com/davidinouye/destructive-deep-learning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidinouye%2Fdestructive-deep-learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31562685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-07-30T18:00:34.359Z","updated_at":"2026-04-08T15:31:07.831Z","avatar_url":"https://github.com/davidinouye.png","language":"Python","funding_links":[],"categories":["🧑‍💻 Code","🧑‍💻 Repos \u003csmall\u003e(18)\u003c/small\u003e"],"sub_categories":["Others","\u003cimg src=\"assets/other.svg\" alt=\"Other\" height=\"20px\"\u003e \u0026nbsp;Other Repos"],"readme":".. -*- mode: rst -*-\n\n|CircleCI|_ |ReadtheDocs|_\n\n.. |CircleCI| image:: https://circleci.com/gh/davidinouye/destructive-deep-learning/tree/master.svg?style=shield\u0026circle-token=:circle-token\n.. _CircleCI: https://circleci.com/gh/davidinouye/destructive-deep-learning\n.. |ReadtheDocs| image:: https://readthedocs.org/projects/destructive-deep-learning/badge/?version=latest\n.. _ReadtheDocs: https://destructive-deep-learning.readthedocs.io/en/latest/?badge=latest\n\n======================================\nDestructive Deep Learning (ddl) README\n======================================\n\n.. default-role:: any\n\nDestructive deep learning estimators and functions.\nEstimators are compatible with scikit-learn.\nSource code is distributed under the BSD 3-clause license.\n\nPlease cite the following paper if you use this code:\n\n    | `Deep Density Destructors`_ (`pdf`_)\n    | David I. Inouye, Pradeep Ravikumar\n    | In *International Conference on Machine Learning* (ICML), 2018.\n\n.. _`Deep Density Destructors`: http://www.cs.cmu.edu/~dinouye/papers/inouye2018-deep-density-destructors-icml2018.pdf\n.. _`pdf`: http://www.cs.cmu.edu/~dinouye/papers/inouye2018-deep-density-destructors-icml2018.pdf\n\nDocumentation\n-------------\n\nUPDATED: Please see the `updated documentation`_ for an API reference and tutorials/demos including\na Quickstart tutorial and MNIST demo.\n\n.. _`updated documentation`: https://destructive-deep-learning.readthedocs.io/en/latest/\n\nEnvironment Setup\n-----------------\n\nEnvironment setup instructions for:\n\n1. Docker or Singularity containers (recommended)\n2. Linux Setup (Ubuntu)\n3. Mac OSX (unsupported)\n\n1. Docker or Singularity Setup\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nBecause `MLPACK`_ is required for the tree density destructors used in the experiments,\nthe suggested installation method is to download and start a shell in a `Docker \u003chttps://www.docker.com/\u003e`_\nor `Singularity \u003chttp://singularity.lbl.gov/\u003e`_ container as below.  \n(If you are using `Docker for Mac`_ or `Docker for Windows`_, you will probably have \nto increase the available memory to Docker for these experiments. See Docker documentation.)\nFor Docker (recommended if available):\n\n.. _`MLPACK`: http://mlpack.org/\n\n.. _`Docker for Mac`: https://docs.docker.com/docker-for-mac/\n\n.. _`Docker for Windows`: https://docs.docker.com/docker-for-windows/\n\n.. code:: console\n\n    docker run -it davidinouye/destructive-deep-learning /bin/bash\n\n\nOr, for Singularity:\n\n.. code:: console\n\n    singularity shell -s /bin/bash shub://davidinouye/destructive-deep-learning\n\n2. Linux Setup (Ubuntu)\n^^^^^^^^^^^^^^^^^^^^^^^\nInstall build essentials and cmake (needed for building mlpack destructors), laplack and blas (for fast linear operations), boost and armadillo libraries (required to build mlpack).\n\n.. code:: console\n\n    apt-get update \u0026\u0026 apt-get install \\\n        build-essential \\\n        cmake \\\n        liblapack-dev \\\n        libblas-dev \\\n        libboost-math-dev \\\n        libboost-program-options-dev \\\n        libboost-test-dev \\\n        libboost-serialization-dev \\\n        libarmadillo-dev\n\n3. Mac OSX (unsupported)\n^^^^^^^^^^^^^^^^^^^^^^^^\nInstall ``homebrew`` as per `homebrew documentation \u003chttps://brew.sh/\u003e`_ (note that this also install the required xcode tools).\nThen, install cmake, armadillo and boost (required to build mlpack) and llvm (required for openmp support for mlpack):\n\n.. code:: console\n\n    brew update \u0026\u0026 brew install \\\n        cmake \\\n        armadillo \\\n        boost \\\n        llvm\n\n\nInstallation\n------------\n\nOnce your environment is setup via one of the methods described above, download and compile the code to link to `MLPACK`_.\nThe first pip install is for ``scikit-learn``, ``cython`` is required to compile ``pot`` and ``ddl``, and ``pot`` and ``nose`` are used in ddl tests.\n\n.. code:: console\n\n    pip install numpy scipy scikit-learn\n    pip install setuptools Cython\n    git clone https://github.com/davidinouye/destructive-deep-learning.git\n    cd destructive-deep-learning\n    pip install .[test]\n\nTo run tests (which uses `pytest \u003chttps://docs.pytest.org/en/latest/\u003e`_), execute:\n\n.. code:: console\n\n    make test\n\nReproduce experiments from ICML 2018 paper\n------------------------------------------\n\nNOTE: `MLPACK`_ is required to reproduce experiments, please\nsee installation instructions. \n\nTo reproduce the 2D experiment in the paper and generate the paper figures\nopen and run the notebook `notebooks/demo_toy_experiment.ipynb \u003cnotebooks/demo_toy_experiment.ipynb\u003e`_ \nor run the notebook from the command line.\nNote that this notebook may take a while to run.\nAlso, if the command below is interrupted with Ctrl+C, the underlying python process\nmay need to be killed manually.\n\n.. code:: console\n\n    jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --execute notebooks/demo_toy_experiment.ipynb\n\nTo reproduce the MNIST and CIFAR-10 experiments execute the command below.\nNote that this script will download the MNIST and CIFAR-10 datasets into \n``data/download_cache`` if not downloaded already.\nThe results are stored in ``data/results`` both the log files and pickle files\nthat include the fitted models.\nNote that the log files will always append to the previous log file rather\nthan overwriting the existing log file.\n\n.. code:: console\n\n    # Download data cache directly since mldata.org is sometimes down\n    wget http://www.cs.cmu.edu/~dinouye/data/data-icml2018.tar.gz \u0026\u0026 tar -xzvf data-icml2018.tar.gz \u0026\u0026 rm data-icml2018.tar.gz\n\n    # Example command for deep copula model and MNIST data\n    python scripts/icml_2018_experiment.py --model_names=deep-copula --data_names=mnist\n\n    # View tail of output log files\n    tail data/results/data-mnist_model-deep-copula_n_jobs-1.log \n\n    # Command for all models and datasets (using commas to separate)\n    python scripts/icml_2018_experiment.py --model_names=deep-copula,image-pairs-copula,image-pairs-tree --data_names=mnist,cifar10\n\n    # Command to run all experiments in parallel using subprocesses\n    python scripts/icml_2018_experiment.py --model_names=deep-copula,image-pairs-copula,image-pairs-tree --data_names=mnist,cifar10 --parallel_subprocesses=True \n\n\n============\nContributing\n============\n\nGeneral coding guidelines\n-------------------------\n\nPlease read through the following high-level guidelines:\n\n1. Zen of Python - https://www.python.org/dev/peps/pep-0020/\n2. Python style guidelines - https://www.python.org/dev/peps/pep-0008/\n3. ``scikit-learn`` coding guidelines -\n   http://scikit-learn.org/stable/developers/contributing.html#coding-guidelines\n\nProject-specific guidelies\n--------------------------\n\nFor this particular project, please follow these additional guidelines:\n\n-  Use lower case with underscores for variable names and functions.\n-  Please use longer names with full spellings especially for public\n   interfaces to allow for super lightweight documentation. The variable\n   names should be descriptive of its function. For example, a\n   constructor name should be ``fitted_canonical_destructor`` rather\n   than ``fitted_destructor`` or ``destructor`` or ``fit_canon_destr``\n   or ``fcd``. Another example, ``univariate_estimators`` rather than\n   ``univ_est`` or ``univariate_est`` or ``uest``. It is much easier to\n   change a long variable name to short one than the other way around.\n-  Methods should generally be private designated by underscore prefix\n   unless sure the method should be exposed publicly.\n-  For non-negative integer count variables prefix with ``n_`` rather\n   than ``num_`` or ``number_of_``\n-  Use variable names ``n_samples``, ``n_features``, and\n   ``n_components`` (number of mixture components, number of PCA\n   vectors, etc) and ``n_layers`` instead of ambiguous single letter\n   variable names like ``n``, ``p`` or ``k``.\n\n-  In the library and tests, please use the logging API instead of print\n   statements. In particular, create a logger for each module and call\n   the appropriate logging function (usually ``logger.debug(message)``)\n\n   .. code:: python\n\n       import logging\n       logger = logging.getLogger(__name__)\n       def foo():\n            logger.debug('Checking inside foo')\n\n-  To avoid the module from outputing anything unless requested, the\n   root module file ``__init__.py`` redirects the logging output to\n   ``None`` as follows:\n\n   .. code:: python\n\n       import logging\n       from logging import NullHandler\n       logging.getLogger(__name__).addHandler(NullHandler())\n\n-  Thus, to view these logs when executing a program and capture\n   warnings as logs for a particular module you must setup logging to\n   output to standard out (and/or a local file). For example, you could\n   write:\n\n   .. code:: python\n\n       logging.basicConfig(stream=sys.stdout)  # Push towards stdout instead of null handler\n       logging.captureWarnings(True)  # Capture warnings in loggers\n       logging.getLogger('ddl').setLevel(logging.DEBUG)  # Show everything above DEBUG level for the root ddl module\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidinouye%2Fdestructive-deep-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidinouye%2Fdestructive-deep-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidinouye%2Fdestructive-deep-learning/lists"}