Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
earth_observation_public
Climax
Commits
77e1b3b0
Commit
77e1b3b0
authored
3 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed wrong initialization.
parent
1676fe09
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
climax/core/loss.py
+9
-10
9 additions, 10 deletions
climax/core/loss.py
with
9 additions
and
10 deletions
climax/core/loss.py
+
9
−
10
View file @
77e1b3b0
...
@@ -48,7 +48,7 @@ class L1Loss(NaNLoss):
...
@@ -48,7 +48,7 @@ class L1Loss(NaNLoss):
return
F
.
l1_loss
(
y_pred
[
mask
],
y_true
[
mask
],
reduction
=
self
.
reduction
)
return
F
.
l1_loss
(
y_pred
[
mask
],
y_true
[
mask
],
reduction
=
self
.
reduction
)
class
BernoulliLoss
(
NaNLoss
):
class
Bernoulli
Gamma
Loss
(
NaNLoss
):
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
min_amount
=
0
):
min_amount
=
0
):
...
@@ -57,13 +57,6 @@ class BernoulliLoss(NaNLoss):
...
@@ -57,13 +57,6 @@ class BernoulliLoss(NaNLoss):
# minimum amount of precipitation to be classified as precipitation
# minimum amount of precipitation to be classified as precipitation
self
.
min_amount
=
min_amount
self
.
min_amount
=
min_amount
class
BernoulliGammaLoss
(
BernoulliLoss
):
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
min_amount
=
0
):
super
().
__init__
(
size_average
,
reduce
,
reduction
)
def
forward
(
self
,
y_pred
,
y_true
):
def
forward
(
self
,
y_pred
,
y_true
):
# convert to float32
# convert to float32
...
@@ -111,12 +104,15 @@ class BernoulliGammaLoss(BernoulliLoss):
...
@@ -111,12 +104,15 @@ class BernoulliGammaLoss(BernoulliLoss):
return
p
*
shape
*
scale
return
p
*
shape
*
scale
class
BernoulliGenParetoLoss
(
Bernoulli
Loss
):
class
BernoulliGenParetoLoss
(
NaN
Loss
):
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
min_amount
=
0
):
min_amount
=
0
):
super
().
__init__
(
size_average
,
reduce
,
reduction
)
super
().
__init__
(
size_average
,
reduce
,
reduction
)
# minimum amount of precipitation to be classified as precipitation
self
.
min_amount
=
min_amount
def
forward
(
self
,
y_pred
,
y_true
):
def
forward
(
self
,
y_pred
,
y_true
):
# convert to float32
# convert to float32
...
@@ -157,12 +153,15 @@ class BernoulliGenParetoLoss(BernoulliLoss):
...
@@ -157,12 +153,15 @@ class BernoulliGenParetoLoss(BernoulliLoss):
return
self
.
reduce
(
loss
)
return
self
.
reduce
(
loss
)
class
BernoulliWeibullLoss
(
Bernoulli
Loss
):
class
BernoulliWeibullLoss
(
NaN
Loss
):
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
def
__init__
(
self
,
size_average
=
None
,
reduce
=
None
,
reduction
=
'
mean
'
,
min_amount
=
0
):
min_amount
=
0
):
super
().
__init__
(
size_average
,
reduce
,
reduction
)
super
().
__init__
(
size_average
,
reduce
,
reduction
)
# minimum amount of precipitation to be classified as precipitation
self
.
min_amount
=
min_amount
def
forward
(
self
,
y_pred
,
y_true
):
def
forward
(
self
,
y_pred
,
y_true
):
# convert to float32
# convert to float32
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment