Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
ce2d24bc
Commit
ce2d24bc
authored
Jul 02, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GRAPH|DIST] distri partial test with n =3
parent
2eb471ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
Matrice.hs
src/Gargantext/Viz/Graph/Distances/Matrice.hs
+19
-4
No files found.
src/Gargantext/Viz/Graph/Distances/Matrice.hs
View file @
ce2d24bc
...
...
@@ -10,7 +10,6 @@ Portability : POSIX
This module aims at implementig distances of terms context by context is
the same referential of corpus.
Implementation use Accelerate library which enables GPU and CPU computation:
* Manuel M. T. Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell, and Vinod Grover.
...
...
@@ -321,7 +320,7 @@ crossProduct :: Dim -> Acc (Matrix Double) -> Acc (Matrix Double)
crossProduct
n
m
=
trace
(
P
.
show
(
run
m'
,
run
m''
))
$
zipWith
(
*
)
m'
m''
where
m'
=
cross
n
m
m''
=
cross
n
(
transpose
m
)
m''
=
transpose
$
cross
n
m
crossT
::
Matrix
Double
->
Matrix
Double
crossT
=
run
.
transpose
.
use
...
...
@@ -448,7 +447,23 @@ p_ m = zipWith (/) m (n_ m)
-- * For Tests (to be removed)
-- | Test perfermance with this matrix
-- TODO : add this in a benchmark folder
distriTest
::
Matrix
Double
distriTest
=
distributional
$
matrix
100
[
1
..
]
distriTest
::
Int
->
Matrix
Double
distriTest
n
=
distributional
(
matrix
n
theMatrix
)
where
theMatrix
|
(
P
.==
)
n
3
=
[
1
,
1
,
2
,
1
,
2
,
3
,
2
,
3
,
4
]
|
P
.
otherwise
=
[
1
,
1
,
1
,
2
]
theResult
|
(
P
.==
)
n
2
=
let
r
=
1.6094379124341003
in
[
0
,
r
,
r
,
0
]
|
P
.
otherwise
=
[
1
,
1
]
-----------------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment