Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
apollon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaß, Michael
apollon
Commits
080d7bf3
Commit
080d7bf3
authored
4 years ago
by
Blaß, Michael
Browse files
Options
Downloads
Patches
Plain Diff
Renamed former init* methods.
parent
02ae472f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/apollon/som/utilities.py
+5
-5
5 additions, 5 deletions
src/apollon/som/utilities.py
with
5 additions
and
5 deletions
src/apollon/som/utilities.py
+
5
−
5
View file @
080d7bf3
...
...
@@ -115,9 +115,9 @@ def best_match(weights: Array, inp: Array, metric: str):
return
dists
.
argmin
(
axis
=
0
),
dists
.
min
(
axis
=
0
)
def
init
_pca
(
data
:
Array
,
shape
:
Shape
,
adapt
:
bool
=
True
)
->
Array
:
"""
Compute initial SOM weights by the first two principal
components of the
input data.
def
sample
_pca
(
data
:
Array
,
shape
:
Shape
,
adapt
:
bool
=
True
)
->
Array
:
"""
Compute initial SOM weights by
sampling from
the first two principal
components of the
input data.
Args:
data: Input data set.
...
...
@@ -143,7 +143,7 @@ def init_pca(data: Array, shape: Shape, adapt: bool = True) -> Array:
return
weights
def
init
_r
a
nd
om
(
data
:
Array
,
shape
:
Shape
)
->
Array
:
def
sample
_rnd
(
data
:
Array
,
shape
:
Shape
)
->
Array
:
"""
Compute initial SOM weights by sampling uniformly from the data space.
Args:
...
...
@@ -159,7 +159,7 @@ def init_random(data: Array, shape: Shape) -> Array:
np
.
random
.
uniform
(
*
data_limits
[
1
],
n_units
)))
def
init_simplex
(
n_features
,
n_units
):
def
sample_stm
(
n_features
,
n_units
):
"""
Initialize the weights with stochastic matrices.
The rows of each n by n stochastic matrix are sampes drawn from the
...
...
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