The pyrelational package offers a flexible workflow to enable active learning with as little change to the models and datasets as possible

pyrelational

Quick install

pip install pyrelational

Organisation of repository

  • pyrelational contains the source code for the pyrelational package. It contains the main sub-packages for active learning strategies, various informativeness measures, and methods for estimating posterior uncertainties.
  • examples contains various example scripts and notebooks detailing how the package can be used
  • tests unit tests for pyrelational package
  • docs docs and assets for docs

The pyrelational package

Example

# Active Learning package
import pyrelational as pal
from pyrelational.data.data_manager import GenericDataManager
from pyrelational.strategies.generic_al_strategy import GenericActiveLearningStrategy
from pyrelational.models.generic_model import GenericModel

# Instantiate data-loaders, models, trainers the usual Pytorch/PytorchLightning way
# In most cases, no change is needed to current workflow to incorporate
# active learning
data_manager = GenericDataManager(dataset, train_mask, validation_mask, test_mask)

# Create a model class that will handle model instantiation
model = GenericModel(ModelConstructor, model_config, trainer_config, **kwargs)

# Use the various implemented active learning strategies or define your own
al_manager = GenericActiveLearningStrategy(data_manager=data_manager, model=model)
al_manager.theoretical_performance(test_loader=test_loader)
al_manager.full_active_learning_run(num_annotate=100, test_loader=test_loader)

Overview

The pyrelational package offers a flexible workflow to enable active learning with as little change to the models and datasets as possible. It is partially inspired by Robert (Munro) Monarch's book: "Human-In-The-Loop Machine Learning" and shares some vocabulary from there. It is principally designed with PyTorch in mind, but can be easily extended to work with other libraries.

For a primer on active learning, we refer the reader to Burr Settles's survey [reference]. In his own words

The key idea behind active learning is that a machine learning algorithm can achieve greater accuracy with fewer training labels if it is allowed to choose the data from which it learns. An active learner may pose queries, usually in the form of unlabeled data instances to be labeled by an oracle (e.g., a human annotator). Active learning is well-motivated in many modern machine learning problems, where unlabeled data may be abundant or easily obtained, but labels are difficult, time-consuming, or expensive to obtain.

Overview

The pyrelational package decomposes the active learning workflow into four main components: 1) a data manager, 2) a model, 3) an acquisition strategy built around informativeness scorer, and 4) an oracle (see Figure above). Note that the oracle is external to the package.

The data manager (defined in pyrelational.data.data_manager.GenericDataManager) wraps around a PyTorch Dataset and handles dataloader instantiation as well as tracking and updating of labelled and unlabelled sample pools.

The model (subclassed from pyrelational.models.generic_model.GenericModel) wraps a user defined ML model (e.g. PyTorch Module, Pytorch Lightning Module, or scikit-learn estimator) and handles instantiation, training, testing, as well as uncertainty quantification (e.g. ensembling, MC-dropout). It also enables using ML models that directly estimate their uncertainties such as Gaussian Processes (see examples/demo/model_gaussianprocesses.py).

The active learning strategy (which subclass pyrelational.strategies.generic_al_strategy.GenericActiveLearningStrategy) revolves around an informativeness score that serve as the basis for the selection of the query sent to the oracle for labelling. We define various strategies for classification, regression, and task-agnostic scenarios based on informativeness scorer defined in pyrelational.informativeness.

Prerequisites and setup

For those just using the package, installation only requires standard ML packages and PyTorch. Starting with a new virtual environment (miniconda environment recommended), install standard learning packages and numerical tools.

pip install -r requirements.txt

If you wish to contribute to the code, run pre-commit install after the above step.

Building the docs

Make sure you have sphinx and sphinx-rtd-theme packages installed (pip install sphinx sphinx_rtd_theme will install this).

To generate the docs, cd into the docs/ directory and run make html. This will generate the docs at docs/_build/html/index.html.

Quickstart & examples

The examples/ folder contains multiple scripts and notebooks demonstrating how to use pyrelational effectively.

The diverse examples scripts and notebooks aim to showcase how to use pyrelational in various scenario. Specifically,

  • examples with regression

    • lightning_diversity_regression.py
    • lightning_mixed_regression.py
    • mcdropout_uncertainty_regression.py
    • model_gaussianprocesses.py
    • model_badge.py
  • examples with classification tasks

    • ensemble_uncertainty_classification.py
    • lightning_diversity_classification.py
    • lightning_representative_classification.py
    • mcdropout_uncertainty_classification.py
    • scikit_estimator.py
  • examples with task-agnostic acquisition

    • lightning_diversity_classification.py
    • lightning_representative_classification.py
    • lightning_diversity_regression.py
    • model_badge.py
  • examples showcasing different uncertainty estimator

    • ensemble_uncertainty_classification.py
    • mcdropout_uncertainty_classification.py
    • gpytorch_integration.py
    • model_badge.py
  • examples custom acquisition strategy

    • model_badge.py
    • lightning_mixed_regression.py
  • examples custom model

    • model_gaussianprocesses.py

Uncertainty Estimation

  • MCDropout
  • Ensemble of models (a.k.a. commitee)
  • DropConnect (coming soon)
  • SWAG (coming soon)
  • MultiSWAG (coming soon)

Informativeness scorer included in the library

Regression (N.B. pyrelational currently only supports single scalar regression tasks)

  • Greedy
  • Least confidence
  • Expected improvement
  • Thompson Sampling
  • Upper confidence bound (UCB)
  • BALD
  • BatchBALD (coming soon)

Classification (N.B. pyrelational does not support multi-label classification at the moment)

  • Least confidence
  • Margin confidence
  • Entropy based confidence
  • Ratio based confidence
  • BALD
  • Thompson Sampling (coming soon)
  • BatchBALD (coming soon)

Model agnostic and diversity sampling based approaches

  • Representative sampling
  • Diversity sampling
  • Random acquisition
  • BADGE
Owner
Relation Therapeutics
Developing therapies to treat diseases of aging and increase human longevity.
Relation Therapeutics
Comments
  • Datasets for benchmarking strategies

    Datasets for benchmarking strategies

    Modules to download and process datasets from online sources intotorch.utils.data.Dataset instances, with additional attributes for (stratified) k-fold CV as described in the paper.

    This incurs a few new dependencies namely openpyxl, xlrd, and pyreadr for processing the excel and R data storage formats for original raw datas.

    Also included are utility functions for transforming each of the datasets into datamanagers that have "cold" or "warm" label initialisations for benchmarking AL strategies on the datasets.

    Includes tests for all the modules implemented

  • Changing resolution of train/test/validation indices in datamanager. And make data manager mypy compliant

    Changing resolution of train/test/validation indices in datamanager. And make data manager mypy compliant

    This PR simplifies the resolution of the train/test/validation indices in the datamanager. An image has been added to the doc string to explain this. Tests for the resolution of indices for all cases have also been added.

  • Bump pre-commit from 2.17.0 to 2.20.0

    Bump pre-commit from 2.17.0 to 2.20.0

    Bumps pre-commit from 2.17.0 to 2.20.0.

    Release notes

    Sourced from pre-commit's releases.

    pre-commit v2.20.0

    Features

    • Expose source and object-name (positional args) of prepare-commit-msg hook as PRE_COMMIT_COMIT_MSG_SOURCE and PRE_COMMIT_COMMIT_OBJECT_NAME.

    Fixes

    pre-commit v2.19.0

    Features

    Fixes

    Updating

    • Change pre-commit-validate-config / pre-commit-validate-manifest to pre-commit validate-config / pre-commit validate-manifest.

    pre-commit v2.18.1

    Fixes

    pre-commit v2.18.0

    Features

    ... (truncated)

    Changelog

    Sourced from pre-commit's changelog.

    2.20.0 - 2022-07-10

    Features

    • Expose source and object-name (positional args) of prepare-commit-msg hook as PRE_COMMIT_COMIT_MSG_SOURCE and PRE_COMMIT_COMMIT_OBJECT_NAME.

    Fixes

    2.19.0 - 2022-05-05

    Features

    Fixes

    Updating

    • Change pre-commit-validate-config / pre-commit-validate-manifest to pre-commit validate-config / pre-commit validate-manifest.

    2.18.1 - 2022-04-02

    Fixes

    ... (truncated)

    Commits
    • 78a2d86 v2.20.0
    • e3dc5b7 Merge pull request #2454 from pre-commit/asottile-patch-1
    • ebce88c remove warnings checks
    • d6cc8a1 Merge pull request #2453 from hroncok/python3.11
    • 901e831 Tests: Adjust traceback regexes to allow Python 3.11+ ^^^^^^^
    • 98bb7e6 Merge pull request #2440 from pre-commit/pre-commit-ci-update-config
    • 706d1e9 Merge pull request #2439 from pre-commit/all-repos_autofix_type-checking
    • 3ebd101 [pre-commit.ci] pre-commit autoupdate
    • d8b5930 remove imports from TYPE_CHECKING (py37+)
    • 170335c Merge pull request #2429 from pre-commit/remove-config-option-when-unused
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump flake8-bugbear from 22.1.11 to 22.10.27

    Bump flake8-bugbear from 22.1.11 to 22.10.27

    Bumps flake8-bugbear from 22.1.11 to 22.10.27.

    Release notes

    Sourced from flake8-bugbear's releases.

    22.10.27

    • B027: Ignore @​overload decorator (#306)
    • B023: Also fix map (#305)
    • B023: Avoid false alarms with filter, reduce, key= and return. Added tests for functools (#303)

    22.10.25

    • Make B015 and B018 messages slightly more polite (#298)
    • Add B027: Empty method in abstract base class with no abstract decorator
    • Multiple B024 false positive fixes
    • Move CI to use tox (#294)
    • Move to using PEP621 / pyproject.toml package (#291)
    • Tested in 3.11

    22.9.23

    • add B026: find argument unpacking after keyword argument (#287)
    • Move to setup.cfg like flake8 (#288)

    22.9.11

    • Add B025: Find duplicate except clauses (#284)

    22.8.23

    • Add B024 error code to message for B024 (#276)

    22.8.22

    • Add B024: abstract base class with no abstract methods (#273)

    22.7.1

    22.6.22

    • Don't crash when select / extend_select are None (#261)
    • Ignore lambda arguments for B020 (#259)
    • Fix missing space typos in B021, B022 error messages (#257)

    22.4.25

    • Ignore black formatting for b013 test case (#251)
    • B010 Fix lambda false positive (#246)
    • B008 Fix edge case with lambda functions (#243)

    22.3.23

    • B006 and B008: Detect function calls at any level of the default expression (#239)
    • B020: Fix comprehension false postives (#238)
    • Tweak B019 desc (#237)

    22.3.20

    • B022: No arguments passed to contextlib.suppress (#231)
    • B021: f-string used as docstring. (#230)
    • B020: ensure loop control variable doesn't overrides iterable it iterates (#220)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump flake8 from 4.0.1 to 6.0.0

    Bump flake8 from 4.0.1 to 6.0.0

    Bumps flake8 from 4.0.1 to 6.0.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Update pytorch-lightning requirement from <=1.7.5,>=1.6 to >=1.6,<1.8.4

    Update pytorch-lightning requirement from <=1.7.5,>=1.6 to >=1.6,<1.8.4

    Updates the requirements on pytorch-lightning to permit the latest version.

    Release notes

    Sourced from pytorch-lightning's releases.

    Weekly patch release

    App

    Changed

    • Deduplicate top-level lighting CLI command groups (#15761)
      • lightning add ssh-key CLI command has been transitioned to lightning create ssh-key
      • lightning remove ssh-key CLI command has been transitioned to lightning delete ssh-key
    • Set Torch inference mode for prediction (#15719)
    • Improved LightningTrainerScript start-up time (#15751)
    • Disable XSRF protection in StreamlitFrontend to support upload in localhost (#15684)

    Fixed

    • Fixed debugging with VSCode IDE (#15747)
    • Fixed setting property to the LightningFlow (#15750)

    Lite

    Changed

    • Temporarily removed support for Hydra multi-run (#15737)

    Pytorch

    Changed

    • Temporarily removed support for Hydra multi-run (#15737)
    • Switch from tensorboard to tensorboardx in TensorBoardLogger (#15728)

    Full Changelog: https://github.com/Lightning-AI/lightning/compare/1.8.2...1.8.3

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump black from 22.3.0 to 22.10.0

    Bump black from 22.3.0 to 22.10.0

    Bumps black from 22.3.0 to 22.10.0.

    Release notes

    Sourced from black's releases.

    22.10.0

    Highlights

    • Runtime support for Python 3.6 has been removed. Formatting 3.6 code will still be supported until further notice.

    Stable style

    • Fix a crash when # fmt: on is used on a different block level than # fmt: off (#3281)

    Preview style

    • Fix a crash when formatting some dicts with parenthesis-wrapped long string keys (#3262)

    Configuration

    • .ipynb_checkpoints directories are now excluded by default (#3293)
    • Add --skip-source-first-line / -x option to ignore the first line of source code while formatting (#3299)

    Packaging

    • Executables made with PyInstaller will no longer crash when formatting several files at once on macOS. Native x86-64 executables for macOS are available once again. (#3275)
    • Hatchling is now used as the build backend. This will not have any effect for users who install Black with its wheels from PyPI. (#3233)
    • Faster compiled wheels are now available for CPython 3.11 (#3276)

    Blackd

    • Windows style (CRLF) newlines will be preserved (#3257).

    Integrations

    • Vim plugin: add flag (g:black_preview) to enable/disable the preview style (#3246)
    • Update GitHub Action to support formatting of Jupyter Notebook files via a jupyter option (#3282)
    • Update GitHub Action to support use of version specifiers (e.g. <23) for Black version (#3265)

    22.8.0

    Highlights

    • Python 3.11 is now supported, except for blackd as aiohttp does not support 3.11 as of publishing (#3234)
    • This is the last release that supports running Black on Python 3.6 (formatting 3.6 code will continue to be supported until further notice)
    • Reword the stability policy to say that we may, in rare cases, make changes that affect code that was not previously formatted by Black (#3155)

    ... (truncated)

    Changelog

    Sourced from black's changelog.

    22.10.0

    Highlights

    • Runtime support for Python 3.6 has been removed. Formatting 3.6 code will still be supported until further notice.

    Stable style

    • Fix a crash when # fmt: on is used on a different block level than # fmt: off (#3281)

    Preview style

    • Fix a crash when formatting some dicts with parenthesis-wrapped long string keys (#3262)

    Configuration

    • .ipynb_checkpoints directories are now excluded by default (#3293)
    • Add --skip-source-first-line / -x option to ignore the first line of source code while formatting (#3299)

    Packaging

    • Executables made with PyInstaller will no longer crash when formatting several files at once on macOS. Native x86-64 executables for macOS are available once again. (#3275)
    • Hatchling is now used as the build backend. This will not have any effect for users who install Black with its wheels from PyPI. (#3233)
    • Faster compiled wheels are now available for CPython 3.11 (#3276)

    Blackd

    • Windows style (CRLF) newlines will be preserved (#3257).

    Integrations

    • Vim plugin: add flag (g:black_preview) to enable/disable the preview style (#3246)
    • Update GitHub Action to support formatting of Jupyter Notebook files via a jupyter option (#3282)
    • Update GitHub Action to support use of version specifiers (e.g. <23) for Black version (#3265)

    22.8.0

    Highlights

    • Python 3.11 is now supported, except for blackd as aiohttp does not support 3.11 as of publishing (#3234)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump pytest from 6.2.5 to 7.2.0

    Bump pytest from 6.2.5 to 7.2.0

    Bumps pytest from 6.2.5 to 7.2.0.

    Release notes

    Sourced from pytest's releases.

    7.2.0

    pytest 7.2.0 (2022-10-23)

    Deprecations

    • #10012: Update pytest.PytestUnhandledCoroutineWarning{.interpreted-text role="class"} to a deprecation; it will raise an error in pytest 8.

    • #10396: pytest no longer depends on the py library. pytest provides a vendored copy of py.error and py.path modules but will use the py library if it is installed. If you need other py.* modules, continue to install the deprecated py library separately, otherwise it can usually be removed as a dependency.

    • #4562: Deprecate configuring hook specs/impls using attributes/marks.

      Instead use :pypytest.hookimpl{.interpreted-text role="func"} and :pypytest.hookspec{.interpreted-text role="func"}. For more details, see the docs <legacy-path-hooks-deprecated>{.interpreted-text role="ref"}.

    • #9886: The functionality for running tests written for nose has been officially deprecated.

      This includes:

      • Plain setup and teardown functions and methods: this might catch users by surprise, as setup() and teardown() are not pytest idioms, but part of the nose support.
      • Setup/teardown using the @​with_setup decorator.

      For more details, consult the deprecation docs <nose-deprecation>{.interpreted-text role="ref"}.

    Features

    • #9897: Added shell-style wildcard support to testpaths.

    Improvements

    • #10218: @pytest.mark.parametrize() (and similar functions) now accepts any Sequence[str] for the argument names, instead of just list[str] and tuple[str, ...].

      (Note that str, which is itself a Sequence[str], is still treated as a comma-delimited name list, as before).

    • #10381: The --no-showlocals flag has been added. This can be passed directly to tests to override --showlocals declared through addopts.

    • #3426: Assertion failures with strings in NFC and NFD forms that normalize to the same string now have a dedicated error message detailing the issue, and their utf-8 representation is expresed instead.

    • #7337: A warning is now emitted if a test function returns something other than [None]{.title-ref}. This prevents a common mistake among beginners that expect that returning a [bool]{.title-ref} (for example [return foo(a, b) == result]{.title-ref}) would cause a test to pass or fail, instead of using [assert]{.title-ref}.

    • #8508: Introduce multiline display for warning matching via :pypytest.warns{.interpreted-text role="func"} and enhance match comparison for :py_pytest._code.ExceptionInfo.match{.interpreted-text role="func"} as returned by :pypytest.raises{.interpreted-text role="func"}.

    • #8646: Improve :pypytest.raises{.interpreted-text role="func"}. Previously passing an empty tuple would give a confusing error. We now raise immediately with a more helpful message.

    • #9741: On Python 3.11, use the standard library's tomllib{.interpreted-text role="mod"} to parse TOML.

      tomli{.interpreted-text role="mod"}` is no longer a dependency on Python 3.11.

    • #9742: Display assertion message without escaped newline characters with -vv.

    • #9823: Improved error message that is shown when no collector is found for a given file.

    ... (truncated)

    Commits
    • 3af3f56 Prepare release version 7.2.0
    • bc2c3b6 Merge pull request #10408 from NateMeyvis/patch-2
    • d84ed48 Merge pull request #10409 from pytest-dev/asottile-patch-1
    • ffe49ac Merge pull request #10396 from pytest-dev/pylib-hax
    • d352098 allow jobs to pass if codecov.io fails
    • c5c562b Fix typos in CONTRIBUTING.rst
    • d543a45 add deprecation changelog for py library vendoring
    • f341a5c Merge pull request #10407 from NateMeyvis/patch-1
    • 1027dc8 [pre-commit.ci] auto fixes from pre-commit.com hooks
    • 6b905ee Add note on tags to CONTRIBUTING.rst
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Update pandas requirement from <=1.5.1,>=1.3.0 to >=1.3.0,<1.5.3

    Update pandas requirement from <=1.5.1,>=1.3.0 to >=1.3.0,<1.5.3

    Updates the requirements on pandas to permit the latest version.

    Release notes

    Sourced from pandas's releases.

    Pandas 1.5.2

    This is a patch release in the 1.5.x series and includes some regression and bug fixes. We recommend that all users upgrade to this version.

    See the full whatsnew for a list of all the changes.

    The release will be available on the defaults and conda-forge channels:

    conda install pandas
    

    Or via PyPI:

    python3 -m pip install --upgrade pandas
    

    Please report any issues with the release on the pandas issue tracker.

    Thanks to all the contributors who made this release possible.

    Commits
    • 8dab54d RLS: 1.5.2
    • d78c5e6 Backport PR #49806 on branch 1.5.x (DOC: Update what's new notes for 1.5.2 re...
    • 98c6139 Backport PR #49579 on Branch 1.5.x (BUG: Behaviour change in 1.5.0 when using...
    • 9196f8d Backport PR STYLE enable pylint: method-cache-max-size-none (#49784)
    • 8c4b559 Backport PR #49776 on branch 1.5.x (REGR: arithmetic ops recursion error with...
    • 1616fb3 Backport PR Revert "Add color and size to arguments (#44856)" (#49752)
    • 6f8e174 Backport PR #49720 on branch 1.5.x (Suppress spurious warning) (#49726)
    • 63a91d0 Backport PR #49676 on branch 1.5.x (REGR: Remove groupby's getattribute f...
    • 136271a Backport PR #49615 on branch 1.5.x (REGR: Better warning in pivot_table when ...
    • c9252cf Backport PR #49614 on branch 1.5.x (CI: Updating website sync to new server) ...
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Update numpy requirement from <=1.23.4,>=1.22.0 to >=1.22.0,<1.23.6

    Update numpy requirement from <=1.23.4,>=1.22.0 to >=1.22.0,<1.23.6

    Updates the requirements on numpy to permit the latest version.

    Release notes

    Sourced from numpy's releases.

    v1.23.5

    NumPy 1.23.5 Release Notes

    NumPy 1.23.5 is a maintenance release that fixes bugs discovered after the 1.23.4 release and keeps the build infrastructure current. The Python versions supported for this release are 3.8-3.11.

    Contributors

    A total of 7 people contributed to this release. People with a "+" by their names contributed a patch for the first time.

    • @​DWesl
    • Aayush Agrawal +
    • Adam Knapp +
    • Charles Harris
    • Navpreet Singh +
    • Sebastian Berg
    • Tania Allard

    Pull requests merged

    A total of 10 pull requests were merged for this release.

    • #22489: TST, MAINT: Replace most setup with setup_method (also teardown)
    • #22490: MAINT, CI: Switch to cygwin/[email protected]
    • #22494: TST: Make test_partial_iteration_cleanup robust but require leak...
    • #22592: MAINT: Ensure graceful handling of large header sizes
    • #22593: TYP: Spelling alignment for array flag literal
    • #22594: BUG: Fix bounds checking for random.logseries
    • #22595: DEV: Update GH actions and Dockerfile for Gitpod
    • #22596: CI: Only fetch in actions/checkout
    • #22597: BUG: Decrement ref count in gentype_reduce if allocated memory...
    • #22625: BUG: Histogramdd breaks on big arrays in Windows

    Checksums

    MD5

    8a412b79d975199cefadb465279fd569  numpy-1.23.5-cp310-cp310-macosx_10_9_x86_64.whl
    1b56e8e6a0516c78473657abf0710538  numpy-1.23.5-cp310-cp310-macosx_11_0_arm64.whl
    c787f4763c9a5876e86a17f1651ba458  numpy-1.23.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
    db07645022e56747ba3f00c2d742232e  numpy-1.23.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    c63a6fb7cc16a13aabc82ec57ac6bb4d  numpy-1.23.5-cp310-cp310-win32.whl
    3fea9247e1d812600015641941fa273f  numpy-1.23.5-cp310-cp310-win_amd64.whl
    4222cfb36e5ac9aec348c81b075e2c05  numpy-1.23.5-cp311-cp311-macosx_10_9_x86_64.whl
    6c7102f185b310ac70a62c13d46f04e6  numpy-1.23.5-cp311-cp311-macosx_11_0_arm64.whl
    6b7319f66bf7ac01b49e2a32470baf28  numpy-1.23.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
    3c60928ddb1f55163801f06ac2229eb0  numpy-1.23.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
    6936b6bcfd6474acc7a8c162a9393b3c  numpy-1.23.5-cp311-cp311-win32.whl
    

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Fixing pr workflow so it works for prs from forks

    Fixing pr workflow so it works for prs from forks

    As mentioned in #12, the pr workflow doesn't work when making pre from forked repos as seen [here].(https://github.com/RelationRx/pyrelational/runs/8205172900?check_suite_focus=true)

    Hopefully this should fix it.

  • AL-Pipeline

    AL-Pipeline

    Hi all,

    This is a [draft] PR related to #23 which we have been planning for a while. As #23 describes we propose refactoring the code to decouple the functionality of the active learning pipeline from the active learning strategy.

    In principle the proposed GenericPipeline class will succeed the GenericALStrategy in functionality, and serves to help the user decouple the implementation of their strategies from the business logic of running the pipeline.

    From a structural perspective a Pipeline will be a composition of the following objects

    • a DataManager
    • a ML model
    • an AL strategy
    • an oracle (implementing the new pyrelational.oracle.generic_oracle.GenericOracle interface)

    It retains all of the methods of the previous GenericActiveLearningStrategy it replaces. Of particular note is the active_learning_step method which now calls upon the method of the same name in the strategy, filtering the arguments to match the signature of the concrete method implementations.

    This involves the modification of several existing modules, most notably the GenericActiveLearningStrategy and all of the strategy implementations dependent on it. The refactor also includes a new GenericOracle interface to spur development of different concrete oracle classes.

    The GenericActiveLearningStrategy is now an abstract class which acts as an interface for strategy implementations, each concrete strategy must implement an active_learning_step(self, *args, **kwargs) function. The GenericPipeline.active_learning_step(self, *args, **kwargs) will filter the **kwargs to match signature of the implemented GenericActiveLearningStrategy.active_learning_step method.

    The change also brings forward the implementation of a GenericOracle interface whose concrete implementations must implement the update_dataset(self, data_manager, indices) method.

    Updates will be made to this PR to update all of the tests and documentations towards the new API as we discuss any detailed changes that need to be done to the proposed changes.

  • ALPipeline and ALStrategy

    ALPipeline and ALStrategy

    We propose refactoring the code to decouple the functionality of the active learning pipeline from the active learning strategy. This issue is to discuss the development of an ALPipeline class.

    In principle the proposed ALPipeline will succeed the GenericALStrategy class in functionality, and serves to help the user decouple the implementation of their strategies from the overall pipeline. The ALPipeline will facilitate the communication between

    • a DataManager
    • a ML model
    • an AL strategy
    • an oracle (or None for evaluation mode)

    The proposed action is to:

    1. Copy the functionalities of pyrelational.strategies.GenericALStrategy to pyrelational.pipeline.ALPipeline
    2. Adjust the active_learning_step function such that it simply calls upon the strategy to perform such a step. Maybe by calling a strategy specific function called propose() or suggest()
      • This may call for making an interface which strategies should fulfill corresponding to the informativeness measure utilised and the ranking/selection algorithm used after to keep a consistent interface.
      • My only fear is that this decoupling potentially makes it more difficult to implement sophisticated selection algorithms for the strategies without direct access to iteration counts etc recorded by the ALPipeline in this situation --- without requiring the AL strategy send a message to the ALPipeline, or requiring the user to augment the ALPipeline and overriding the active_learning_step() to provide arguments to the selection algorithm.

    Happy to discuss!

  • Pytorch Lightning deprecated

    Pytorch Lightning deprecated "gpus" argument in trainer

    Pytorch lightning will remove the "gpus" argument in the trainer in favour of using "accelerator" and "devices". See docs: https://pytorch-lightning.readthedocs.io/en/stable/api/pytorch_lightning.trainer.trainer.Trainer.html?highlight=trainer

This python-based package offers a way of creating a parametric OpenMC plasma source from plasma parameters.
This python-based package offers a way of creating a parametric OpenMC plasma source from plasma parameters.

openmc-plasma-source This python-based package offers a way of creating a parametric OpenMC plasma source from plasma parameters. The OpenMC sources a

Oct 18, 2022
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.
Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel order of RGB and BGR. Simple Channel Converter for ONNX.

scc4onnx Very simple NCHW and NHWC conversion tool for ONNX. Change to the specified input order for each and every input OP. Also, change the channel

Oct 16, 2022
Python script that analyses the given datasets and comes up with the best polynomial regression representation with the smallest polynomial degree possible

Python script that analyses the given datasets and comes up with the best polynomial regression representation with the smallest polynomial degree possible, to be the most reliable with the least complexity possible

Aug 1, 2022
Change is Everywhere: Single-Temporal Supervised Object Change Detection in Remote Sensing Imagery (ICCV 2021)
Change is Everywhere: Single-Temporal Supervised Object Change Detection in Remote Sensing Imagery (ICCV 2021)

Change is Everywhere Single-Temporal Supervised Object Change Detection in Remote Sensing Imagery by Zhuo Zheng, Ailong Ma, Liangpei Zhang and Yanfei

Nov 16, 2022
Official PyTorch code for CVPR 2020 paper "Deep Active Learning for Biased Datasets via Fisher Kernel Self-Supervision"
Official PyTorch code for CVPR 2020 paper

Deep Active Learning for Biased Datasets via Fisher Kernel Self-Supervision https://arxiv.org/abs/2003.00393 Abstract Active learning (AL) aims to min

Nov 21, 2022
The repository offers the official implementation of our paper in PyTorch.

Cloth Interactive Transformer (CIT) Cloth Interactive Transformer for Virtual Try-On Bin Ren1, Hao Tang1, Fanyang Meng2, Runwei Ding3, Ling Shao4, Phi

Dec 1, 2022
Virtual Dance Reality Stage: a feature that offers you to share a stage with another user virtually
Virtual Dance Reality Stage: a feature that offers you to share a stage with another user virtually

Portrait Segmentation using Tensorflow This script removes the background from an input image. You can read more about segmentation here Setup The scr

Dec 3, 2022
Deep Learning Datasets Maker is a QGIS plugin to make datasets creation easier for raster and vector data.
Deep Learning Datasets Maker is a QGIS plugin to make datasets creation easier for raster and vector data.

Deep Learning Dataset Maker Deep Learning Datasets Maker is a QGIS plugin to make datasets creation easier for raster and vector data. How to use Down

Dec 5, 2022
Cl datasets - PyTorch image dataloaders and utility functions to load datasets for supervised continual learning

Continual learning datasets Introduction This repository contains PyTorch image

Aug 28, 2022
SeisComP/SeisBench interface to enable deep-learning (re)picking in SeisComP

scdlpicker SeisComP/SeisBench interface to enable deep-learning (re)picking in SeisComP Objective This is a simple deep learning (DL) repicker module

May 13, 2022
Bayesian-Torch is a library of neural network layers and utilities extending the core of PyTorch to enable the user to perform stochastic variational inference in Bayesian deep neural networks

Bayesian-Torch is a library of neural network layers and utilities extending the core of PyTorch to enable the user to perform stochastic variational inference in Bayesian deep neural networks. Bayesian-Torch is designed to be flexible and seamless in extending a deterministic deep neural network architecture to corresponding Bayesian form by simply replacing the deterministic layers with Bayesian layers.

Nov 27, 2022
Deep learning models for change detection of remote sensing images

Change Detection Models (Remote Sensing) Python library with Neural Networks for Change Detection based on PyTorch. ⚡ ⚡ ⚡ I am trying to build this pr

Nov 29, 2022
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.

This is the Vowpal Wabbit fast online learning code. Why Vowpal Wabbit? Vowpal Wabbit is a machine learning system which pushes the frontier of machin

Nov 24, 2022
An easy way to build PyTorch datasets. Modularly build datasets and automatically cache processed results

EasyDatas An easy way to build PyTorch datasets. Modularly build datasets and automatically cache processed results Installation pip install git+https

Dec 14, 2021
Magisk module to enable hidden features on Android 12 Developer Preview 1.

Android 12 Extensions This is a Magisk module that enables hidden features on Android 12 Developer Preview 1. Features Scrolling screenshots Wallpaper

Dec 2, 2022
This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes.
This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes.

Polygon-Yolov5 This repository is based on Ultralytics/yolov5, with adjustments to enable polygon prediction boxes. Section I. Description The codes a

Dec 2, 2022
This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes.
This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes.

Rotate-Yolov5 This repository is based on Ultralytics/yolov5, with adjustments to enable rotate prediction boxes. Section I. Description The codes are

Oct 20, 2022
Simply enable or disable your Nvidia dGPU

EnvyControl (WIP) Simply enable or disable your Nvidia dGPU Usage First clone this repo and install envycontrol with sudo pip install . CLI Turn off y

Nov 30, 2022