Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gext
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Michele Nottoli
gext
Merge requests
!4
Options
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Options
options
into
main
Overview
0
Commits
5
Pipelines
2
Changes
2
Merged
Michele Nottoli
requested to merge
options
into
main
1 year ago
Overview
0
Commits
5
Pipelines
2
Changes
2
Expand
0
0
Merge request reports
Viewing commit
0a72fd08
Prev
Next
Show latest version
2 files
+
12
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
0a72fd08
Lint.
· 0a72fd08
Michele Nottoli
authored
1 year ago
gext/fitting.py
+
10
−
5
Options
"""
Module which provides functionality to perform fitting.
"""
import
abc
from
typing
import
List
import
numpy
as
np
import
abc
class
AbstractFitting
(
abc
.
ABC
):
"""
Base class for fitting schemes.
"""
def
__init__
(
self
,
**
kwargs
):
self
.
set_options
(
**
kwargs
)
@@ -35,6 +37,7 @@ class LeastSquare(AbstractFitting):
}
def
set_options
(
self
,
**
kwargs
):
"""
Set options for least square minimization
"""
self
.
options
=
{}
for
key
,
value
in
kwargs
.
items
():
if
key
in
self
.
supported_options
:
@@ -43,7 +46,7 @@ class LeastSquare(AbstractFitting):
raise
ValueError
(
f
"
Unsupported option:
{
key
}
"
)
for
option
,
default_value
in
self
.
supported_options
.
items
():
if
not
option
in
self
.
options
:
if
option
not
in
self
.
options
:
self
.
options
[
option
]
=
default_value
if
self
.
options
[
"
regularization
"
]
<
0
\
@@ -59,8 +62,10 @@ class LeastSquare(AbstractFitting):
class
QuasiTimeReversible
(
AbstractFitting
):
def
set_options
(
**
kwargs
):
"""
TODO
"""
"""
Quasi time reversible fitting scheme. Not yet implemented.
"""
def
compute
(
self
):
def
set_options
(
self
,
**
kwargs
):
"""
Set options for quasi time reversible fitting
"""
def
compute
(
self
,
vectors
:
List
[
np
.
ndarray
],
target
:
np
.
ndarray
):
"""
Time reversible least square minimization fitting.
"""
Loading