Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ift
NIFTy
Commits
3d3fa9b4
Commit
3d3fa9b4
authored
1 month ago
by
Gordian Edenhofer
Browse files
Options
Downloads
Patches
Plain Diff
likelihood: Add simple __str__ method
parent
a58503b5
No related branches found
No related tags found
1 merge request
!1007
LikelihoodSum: Join/reduce summands in multi-likelihood sum
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/re/likelihood.py
+10
-0
10 additions, 0 deletions
src/re/likelihood.py
with
10 additions
and
0 deletions
src/re/likelihood.py
+
10
−
0
View file @
3d3fa9b4
...
...
@@ -392,6 +392,9 @@ class Likelihood(LazyModel):
lp
=
LikelihoodPartial
(
self
,
primals
=
primals
,
point_estimates
=
point_estimates
)
return
lp
,
lp
.
splitx
(
primals
)[
0
]
def
__str__
(
self
):
return
f
"
{
self
.
__class__
.
__name__
}
()
"
class
LikelihoodPartial
(
Likelihood
):
"""
Likelihood with partially inserted `primals`.
"""
...
...
@@ -491,6 +494,10 @@ class LikelihoodPartial(Likelihood):
"""
return
_parse_point_estimates
(
self
.
point_estimates
,
primals
)[
1
:]
def
__str__
(
self
):
args_str
=
f
"
{
self
.
likelihood
}
, point_estimates=
{
self
.
point_estimates
}
"
return
f
"
{
self
.
__class__
.
__name__
}
(
{
args_str
}
)
"
class
_ChainModel
(
LazyModel
):
forward_left
:
Callable
=
field
(
metadata
=
dict
(
static
=
False
))
...
...
@@ -647,6 +654,9 @@ class LikelihoodWithModel(Likelihood):
likelihood_argnames
=
likelihood_argnames
,
)
def
__str__
(
self
):
return
f
"
{
self
.
likelihood
}
.amend(
{
self
.
forward
}
)
"
class
LikelihoodSum
(
Likelihood
):
likelihood_summands
:
Tuple
[
Likelihood
]
=
field
(
metadata
=
dict
(
static
=
False
))
...
...
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