Skip to content

Update BCELoss in MLP model#756

Merged
you-n-g merged 1 commit intomicrosoft:mainfrom
cuicorey:patch-2
Dec 20, 2021
Merged

Update BCELoss in MLP model#756
you-n-g merged 1 commit intomicrosoft:mainfrom
cuicorey:patch-2

Conversation

@cuicorey
Copy link
Contributor

Change BCELoss to BCEWithLogitsLoss

Description

Change BCELoss to BCEWithLogitsLoss used in MLP model.

Motivation and Context

The BCEWithLogitsLoss combines the sigmoid layer and the BCELoss in one class. It is more numerically stable than a plain Sigmoid followed by a BCELoss. It also keeps the net architecture identical for different loss functions.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@you-n-g
Copy link
Collaborator

you-n-g commented Dec 20, 2021

@cuicorey
Thanks so much for your contribution!

@you-n-g you-n-g merged commit 350fbe9 into microsoft:main Dec 20, 2021
@cuicorey cuicorey deleted the patch-2 branch December 20, 2021 18:43
@you-n-g you-n-g added the enhancement New feature or request label Jan 12, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
you-n-g pushed a commit to you-n-g/qlib that referenced this pull request Aug 16, 2025
* add a check for whether values in score_df are NaN

* fix ci

* change raise to assert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants