{"id":13737778,"url":"https://github.com/continental/hybrid_learning","last_synced_at":"2025-05-08T15:31:33.916Z","repository":{"id":130590173,"uuid":"301639112","full_name":"continental/hybrid_learning","owner":"continental","description":"Libraries for analysing and using linear concept embeddings of deep neural networks","archived":false,"fork":false,"pushed_at":"2022-04-14T20:45:18.000Z","size":8080,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T03:11:10.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://continental.github.io/hybrid_learning/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/continental.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-10-06T06:51:53.000Z","updated_at":"2022-07-09T05:45:45.000Z","dependencies_parsed_at":"2023-06-02T21:15:35.636Z","dependency_job_id":null,"html_url":"https://github.com/continental/hybrid_learning","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continental%2Fhybrid_learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continental%2Fhybrid_learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continental%2Fhybrid_learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/continental%2Fhybrid_learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/continental","download_url":"https://codeload.github.com/continental/hybrid_learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224742387,"owners_count":17362229,"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-08-03T03:02:00.602Z","updated_at":"2024-11-15T06:31:02.097Z","avatar_url":"https://github.com/continental.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Hybrid Learning for DNNs\n========================\n\nThis is a pytorch implementation of parts of a hybrid learning lifecycle for\ncomputer vision convolutional neural networks (CNNs).\nIt aims to verify that visual semantic concepts (defined by labeled examples)\nare (correctly) represented in the latent space of DNNs and correctly used.\nThe core functionalities of the provided modules are:\n\n- *Concept analysis*: Finding and quality assessment of embeddings of concepts in a CNN latent space.\n- *Model extension* methods which allow to e.g. extend CNN outputs by concept predictions.\n- *Custom dataset handles* and some useful transformations for some standard concept datasets.\n- *Logic framework*: A framework to formulate, evaluate, and parse (fuzzy) logic rules,\n  e.g., to check whether CNN outputs and concept predictions are plausible.\n- *Experimentation utils* for preparation, processing, and evaluation of standard experiments.\n\n.. entry-point: installation instructions\n\nInstallation\n------------\n\nGetting the Source Code\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nFor now just use ``git clone``.\n\n\nPreliminaries\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe project is built against ``Python 3.8``.\nFind\n\n- requirements for deployment in the ``requirements.txt`` file,\n- additional requirements for development in the ``requirements-dev.txt`` file, and\n- the direct dependencies in the ``setup.py`` file.\n\nFollow the instructions below for (machine specific) installation.\n\nPytorch for your Machine\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf no build tools are available on your machine, installation of ``torch``\nand ``torchvision`` (:code:`python -m pip install torchvision torch`) may fail\nwith build error.\nThe latest stable version of ``torch`` and ``torchvision`` can be manually\ninstalled by selecting the corresponding ``pip`` install command in the\nQuick start section of the `pytorch homepage \u003chttps://pytorch.org/\u003e`_.\n\n\nWindows: pycocotools for COCO datasets\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe COCO dataset handles use the package ``pycocotools\u003e=2.0``.\nFor Linux, simply proceed with the next section, as ``pycocotools`` can\nbe installed from the repositories via\n\n.. code:: bash\n\n    python -m pip install pycocotools\n\nFor Windows, make sure to have installed\n\n- the ``C++`` *Build Tools for Visual Studio Code* from\n  `here \u003chttps://visualstudio.microsoft.com/downloads/\u003e`_\n- ``numpy\u003e=1.18.2`` (:code:`python -m pip install numpy`)\n- ``Cython\u003e=0.29.16`` (:code:`python -m pip install Cython`)\n\nThen one can build the python3 pycocotools for Windows e.g. using the\nfollowing port:\n\n.. code:: bash\n\n    python -m pip install \"git+https://github.com/philferriere/cocoapi.git#egg=pycocotools\u0026subdirectory=PythonAPI\"\n\nInstallation of other packages\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo install the requirements for deployment simply install them via the\nprovided ``requirements.txt`` file:\n\n.. code:: bash\n\n    python -m pip install -r requirements.txt\n\nFor development (test execution, linting, documentation generation),\ninstall from ``requirements-dev.txt``:\n\n.. code:: bash\n\n    python -m pip install -r requirements-dev.txt\n\nIf you encounter an memory error you could also disable pip caching by\n\n.. code:: bash\n\n    python -m pip --no-cache-dir install -r requirements.txt\n\n\nCreate and Install as Package\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo create an installable wheel, make sure ``setuptools`` and ``wheel`` are installed\nand up-to-date (usually pre-installed in virtual environments):\n\n.. code:: bash\n\n    python -m pip install --upgrade setuptools wheel\n\nBuild the wheel into the directory ``dist``:\n\n.. code:: bash\n\n    python setup.py bdist_wheel -d dist\n\nNow the built wheel package can be installed into any environment:\n\n.. code:: bash\n\n    python -m pip install /path/to/dist/hybrid_learning-VERSION.whl\n\nIf any installation issues occur due to missing torch or torchvision dependencies,\nmanually ensure a current version of ``torch`` and ``torchvision`` is installed\n(see Preliminaries section).\n\n\n\nFor Developers\n---------------\n\nDocumentation Generation\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo generate the `sphinx \u003chttps://www.sphinx-doc.org/\u003e`_ documentation,\nmake sure the following packages are installed (included in development requirements):\n\n- ``sphinx``\n- ``sphinx_automodapi``\n- ``autoclasstoc``\n- ``sphinx_rtd_theme``\n\nThen call:\n\n.. code:: bash\n\n    python -m sphinx docs/source docs/build\n\nThe entry point for the resulting documentation then is ``docs/build/index.html``.\nNote that you will need an internet connection to successfully download the\nobject inventories for cross-referencing external documentations.\n\nFor a clean build remove the directories\n\n- ``docs/build``: The built HTML documentation as well as build artifacts\n- ``docs/source/apiref/generated``: The auto-generated API documentation files\n\nOne can also use the provided Makefile at ``docs/Makefile``.\nFor this, ensure the shell command :code:`python -m sphinx` can be executed in the\ncommand line. Then call one of\n\n.. code:: bash\n\n    make -f docs/Makefile clean                        # clean artifacts from previous builds\n    make -f docs/Makefile build                        # normal sphinx html build\n    make -f docs/Makefile build SPHINXOPTS=\"-b latex\"  # build with additional options for sphinx\n\n\nCode checks\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n**Preliminaries**: The train and test images and the ``pytest`` python package.\n\nFor mini training and testing, example images need to be downloaded.\nThe needed images are specified in the items of the ``images`` list in the JSON annotation files.\nThe online sources of the images can be found in the ``flickr_url`` field of the items in the ``images`` list,\nthe required filenames can be found in the ``file_name`` field.\nFind the annotation files in ``dataset/coco_test/annotations`` and put\n\n- images listed in the training annotation file into ``dataset/coco_test/images/train2017``,\n- images listed in the validation annotation file into ``dataset/coco_test/images/val2017``.\n\nFor running the tests, ensure ``pytest`` is installed (included in development requirements),\nand call from within the project root directory:\n\n.. code:: bash\n\n    python -m pytest -c pytest.ini test/\n\nFor running `doctest \u003chttps://docs.python.org/3/library/doctest.html\u003e`_ on the\ndocstrings run\n\n.. code:: bash\n\n    python -m pytest -c pytest.ini hybrid_learning/ docs/source/\n\nFor all at once\n\n.. code:: bash\n\n    python -m pytest -c pytest.ini hybrid_learning/ docs/source/ test/\n\n\n.. entry-point: contributing\n\n\nExample scripts\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nFor some example scripts have a look at the ``script`` folder\nand follow the instructions in the ``script/README.md``.\n\n\nContributing\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSee the project's ``CONTRIBUTING.md``.\n\n\n\n.. entry-point: license\n\nLicense\n-------------\n\nCopyright (c) 2022 Continental Corporation. All rights reserved.\n\nThis repository is licensed under the MIT license.\nSee ``LICENSE.txt`` for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinental%2Fhybrid_learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontinental%2Fhybrid_learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontinental%2Fhybrid_learning/lists"}