Coder Social home page Coder Social logo

ayrna / dlordinal Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 1.0 583 KB

Open-source Python toolkit focused on deep learning with ordinal methodologies

License: BSD 3-Clause "New" or "Revised" License

Python 46.06% Dockerfile 0.19% Shell 0.23% Jupyter Notebook 53.53%
deep-learning ordinal-classification python pytorch scikit-learn

dlordinal's People

Contributors

franberchez avatar javierbg avatar victormvy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

rafaaygar

dlordinal's Issues

PytorchEstimator predict and predict_proba interface changes

The predict and predict_proba methods within the PytorchEstimator class should be modified to return numpy arrays instead of Tensors. This adjustment is necessary to align with the interface conventions of scikit-learn estimators, ensuring seamless integration and consistency across frameworks.

Also, a verbose parameter should be included to enable or disable the messages which are printed in the current version.

[API, MNT] `PytorchEstimator` deprecation

Describe the issue

PytorchEstimator currently offers a very basic classifier with the interface of scikit-learn. However, it lacks numerous essential functionalities. Some python packages like skorch provide implementations for these missing features. Since dlordinal elements seamlessly integrate with such packages, it seems unnecessary and beyond the package's intended scope to have an estimator class within it.

Suggest a potential alternative/fix

The PytorchEstimator class should be deprecated and subsequently removed from this package. Instead, users should be encouraged to utilize third-party packages that already incorporate a PyTorch estimator with a scikit-learn interface. To facilitate this transition, comprehensive tutorials should be provided, describing how to seamlessly integrate dlordinal with these third-party alternatives.

Additional context

No response

[API] `distributions` module should be renamed to `soft_labelling`

distributions module do not implement probability distributions. Instead, it employs different probability distributions to determine soft labels for a given number of splits. Therefore, the whole module should be renamed to softlabelling and the functions that it contains should also be renamed as follows:

  • get_beta_probabilities -> get_beta_softlabels
  • get_binomial_probabilities -> get_binomial_softlabels
  • get_exponential_probabilities -> get_exponential_softlabels
  • get_triangular_probabilities -> get_triangular_softlabels
  • get_general_triangular_probabilities -> get_general_triangular_softlabels

Avoid default value for `num_classes` parameter in Unimodal Loss Functions

The num_classes parameter in unimodal loss functions currently has a default value. However, it's important to note that specifying the correct number of classes for this parameter must be done for every case. Relying on a default value may lead to errors that are difficult to diagnose.

Recommendation:

  • Remove the default value for the num_classes parameter in BetaCrossEntropyLoss, BinomialCrossEntropyLoss, ExponentialRegularisedCrossEntropyLoss, GeneralTriangularCrossEntropyLoss, PoissonCrossEntropyLoss, and TriangularCrossEntropyLoss

[ENH, API] PytorchEstimator verbosity

Currently, the PytorchEstimator lacks flexibility in managing verbosity during the training phase. It uniformly prints progress updates on each epoch, displaying only the current epoch and the total number of epochs. However, there are scenarios where users might prefer to customize this output. Some may seek to remove this message, while others might find it beneficial to include additional information such as the loss value per epoch.

Is it possible to add a verbose parameter to achieve this? Thank you!

[MNT] `label_smoothing` parameter of `CrossEntropyLoss` should not be exposed in soft labelling loss functions

Describe the issue

label_smoothing parameter of CrossEntropyLoss applies label smoothing by mixing the one-hot targets with a uniform distribution. However, in soft labelling loss functions, it makes no sense to mix an already soft label encoding with a uniform distribution.

Suggest a potential alternative/fix

The label_smoothing parameter should be removed from

  • PoissonCrossEntropyLoss
  • BinomialCrossEntropyLoss
  • ExponentialCrossEntropyLoss
  • BetaCrossEntropyLoss
  • TriangularCrossEntropyLoss
  • GeneralTriangularCrossEntropyLoss

Then, the value passed to the CrossEntropyLoss when initialising the ce_loss attribute should be 0.

Additional context

Thank you!

[BUG] Numerical instability in CLM activation layer

Describe the bug

The CLM layer with cloglog and logit link functions has a numerical instability in the computation of the z3 variable. It uses a torch.exp(-z3) so when z3 is aproximately above 15 it returns infinity.

Steps/Code to reproduce the bug

.

Expected results

.

Actual results

.

[ENH, DOC] Displaying descriptions of the class attributes.

Hello team!
Thank you for this very useful tool.
I've been working with it for a few days and I've detected that there is a problem with displaying the descriptions of the class attributes of the datasets module in the software documentation.

Could you please fix it?

Thank you again!

Warnings in tutorials

The tutorials require an update to work with the latest versions of torch and torchvision. Currently in the model creation section they return the following warnings

UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=ResNet18_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet18_Weights.DEFAULT` to get the most up-to-date weights.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.