Skip to content
Snippets Groups Projects

Fading some algorithms from bob.learn.linear

Closed Tiago de Freitas Pereira requested to merge linear-py into master
5 unresolved threads

Hi,

This MR goes in the direction of our medium term goal of getting rid of C++ code from our side. In this MR I will:

  • Get rid of PCA (in favor of scikit-learn) (and get rid of the machine of course)
  • Get rid of LDA (in favor of scikit-learn)
  • Get rid of LogisticRegression (in favor of scikit-learn)
  • Get rid of BIC (no one uses it)
  • Get rid of GFK (no one uses it, this I've implemented for my thesis)
  • Port Whitening to python (the bob.bio.spear is going to use it) (eventually moved to scikit-learn)
  • Port WCCN to python (the bob.bio.spear is going to use it) (eventually moved to scikit-learn)

As with the database porting, I'll do it little by little along the weeks. In one day we'll finish it.

Closes #14 #13

Edited by Tiago de Freitas Pereira

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
33 .. math::
34 W = cholesky([Cov(X)]^{-1})
35
36
37 References:
38 - 1. https://rtmath.net/help/html/e9c12dc0-e813-4ca9-aaa3-82340f1c5d24.htm
39 - 2. http://en.wikipedia.org/wiki/Cholesky_decomposition
40
41 """
42
43 def __init__(self, pinv: bool = False):
44 self.pinv = pinv
45
46 def fit(self, X: da.Array, y=None):
47 # 1. Computes the mean vector and the covariance matrix of the training set
48 mu = da.mean(X, axis=0)
  • when we refactored bob.learn.em, we realized that it's not a good idea to always use dask as it might slow things down. This code should work both against numpy and dask arrays. A lot of numpy functions already work on dask arrays. Please look at bob.learn.em to see how we handled this.

  • Please register or sign in to reply
  • 21 21 - {{ compiler('c') }}
    22 22 - {{ compiler('cxx') }}
    23 23 - pkg-config {{ pkg_config }}
  • 44 36 - {{ pin_compatible('scipy') }}
    37 - {{ pin_compatible('dask') }}
    38 - {{ pin_compatible('scikit-learn') }}
    45 39
    46 40 test:
    47 41 imports:
    48 42 - {{ name }}
    49 43 commands:
    50 - nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
    44 - pytest --capture=no --verbose --cov {{ name }} --cov-config {{ project_dir }}/pyproject.toml --cov-report term-missing --cov-report html:{{ project_dir }}/sphinx/coverage --cov-report xml:{{ project_dir }}/coverage.xml --pyargs {{ name }}
    51 45 - sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx
    52 46 - sphinx-build -aEb doctest {{ project_dir }}/doc sphinx
    53 47 - conda inspect linkages -p $PREFIX {{ name }} # [not win]
    54 48 - conda inspect objects -p $PREFIX {{ name }} # [osx]
    55 49 requires:
    56 50 - nose {{ nose }}
  • 12 12
    13 13 .. todolist::
    14 14
    15 This package includes the definition of a linear machine, which is capable of
    16 either projecting the input data into maximally spread representations,
    17 linearly, or providing linear separation planes for multi-class data samples.
    18 15 The package includes the machine definition *per se* and a selection of
    19 16 different trainers for specialized purposes:
  • Can somebody, please, make these improvements?

    Thanks

    Edited by Tiago de Freitas Pereira
  • since wccn and whitening are only used in bob.learn.em, we will move those there and deprecate this package.

  • That's a great idea

  • With this, we'll shut down bob.learn.linear and bob.learn.activation in one shot

  • mentioned in merge request bob.learn.em!44 (merged)

  • Closing this one in favor of

    bob.learn.em!44 (merged)

  • Tiago de Freitas Pereira changed the description

    changed the description

  • Please register or sign in to reply
    Loading