Skip to content

Introduce MeanSquaredError as Loss Function#2570

Merged
wschin merged 50 commits intoonnx:masterfrom
KsenijaS:meansquare
Feb 21, 2020
Merged

Introduce MeanSquaredError as Loss Function#2570
wschin merged 50 commits intoonnx:masterfrom
KsenijaS:meansquare

Conversation

@KsenijaS
Copy link
Copy Markdown
Contributor

@KsenijaS KsenijaS commented Jan 24, 2020

This ONNX function calculates loss using the equation for mean square error.
As inputs it takes tensors of arbitrary shapes and, depending on the reduction type, it outputs a scalar (if reduction is sum or mean) or the tensor of same shape as input (if reduction is none)

PyTorch: https://pytorch.org/docs/stable/nn.html#torch.nn.MSELoss
TensorFlow: https://www.tensorflow.org/api_docs/python/tf/keras/losses/MeanSquaredError

@KsenijaS KsenijaS requested a review from a team as a code owner January 24, 2020 23:15
Comment thread onnx/backend/test/case/node/meansquareerror.py Outdated
Comment thread onnx/backend/test/case/node/meansquareerror.py Outdated
Comment thread onnx/defs/loss/defs.cc Outdated
Comment thread onnx/defs/loss/defs.cc Outdated
Comment thread docs/Changelog.md Outdated
Comment thread docs/Changelog.md
Copy link
Copy Markdown
Contributor

@SherlockNoMad SherlockNoMad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@SherlockNoMad
Copy link
Copy Markdown
Contributor

Looks good to me. Wei-Sheng will help you further review this in details.

Comment thread onnx/backend/test/case/node/meansquareerror.py Outdated
Comment thread onnx/backend/test/case/node/meansquareerror.py
Comment thread onnx/defs/loss/defs.cc Outdated
Comment thread onnx/backend/test/case/node/meansquareerror.py Outdated
@wschin
Copy link
Copy Markdown
Collaborator

wschin commented Jan 30, 2020

This PR introduces a new operator. Please make sure this PR follows the rules agreed by Operator SIG

@wschin wschin requested a review from a team January 30, 2020 17:34
Comment thread docs/Changelog.md Outdated
Comment thread onnx/defs/math/defs.cc
Copy link
Copy Markdown
Collaborator

@wschin wschin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the hard works.

@wschin wschin merged commit d2fe4f2 into onnx:master Feb 21, 2020
@chinhuang007 chinhuang007 added this to the 1.7 milestone Feb 27, 2020
codemzs added a commit to codemzs/onnx that referenced this pull request Apr 25, 2020
This reverts commit d2fe4f2.

# Conflicts:
#	docs/Changelog.md
#	docs/Operators.md
#	docs/TestCoverage.md
#	onnx/defs/math/defs.cc
#	onnx/defs/operator_sets.h
codemzs added a commit to codemzs/onnx that referenced this pull request Apr 26, 2020
This reverts commit d2fe4f2.

# Conflicts:
#	docs/Changelog.md
#	docs/Operators.md
#	docs/TestCoverage.md
#	onnx/defs/math/defs.cc
#	onnx/defs/operator_sets.h
This was referenced Apr 26, 2020
wschin pushed a commit that referenced this pull request Apr 29, 2020
* Revert "Introduce MeanSquaredError as Loss Function (#2570)"

This reverts commit d2fe4f2.

# Conflicts:
#	docs/Changelog.md
#	docs/Operators.md
#	docs/TestCoverage.md
#	onnx/defs/math/defs.cc
#	onnx/defs/operator_sets.h

* Update MD files.

* update MD files.

* Trigger builds.

* Trigger builds.
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Initial commit for Mean square error loss operator

* Update defs.cc

* Use opset 12 instead of 10

* Add Changelog.md

* Add Operators.md

* Add test for Mean Square Error

* Add TestCoverage.md

* Add more tests

* Add propagation for shape and type

* fix build issues

* Update tests

* Add onnx and pb files

* Add shape and inference tests

* Add documentation for score and label

* Update documentation

* Update tests

* Use AddQueriedFunctionBody

* hasInputShape check

* Rename Error to Distance

* Remove mean_square_error_none_weights

* Update tests

* Use SetContextDependentFunctionBodyBuilder

* Update docs

* fix flake8 errors

* tab to space

* tab to space

* remove duplicate

* update loss function

* update docs

* Address reviewers comments

* Address comments

* fix tests

* update docs

* transfer MeanSquaredDistance to math folder

* update docs

* update shape and inference propagation

* Update docs

* Add type annotation

* Update type signature

* Ignore type signature

* Add whitespace

* update docs

Co-authored-by: Emad Barsoum <ebarsoum@gmail.com>
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Revert "Introduce MeanSquaredError as Loss Function (onnx#2570)"

This reverts commit d2fe4f2.

# Conflicts:
#	docs/Changelog.md
#	docs/Operators.md
#	docs/TestCoverage.md
#	onnx/defs/math/defs.cc
#	onnx/defs/operator_sets.h

* Update MD files.

* update MD files.

* Trigger builds.

* Trigger builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: operator Issues related to ONNX operators topic: training Issues related to ONNX training

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants