Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
gargantext
haskell-gargantext
Commits
e510b73c
Commit
e510b73c
authored
Oct 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Distributional, before last step (WIP)
parent
e741619e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
8 deletions
+34
-8
Distributional.hs
...ntext/Core/Methods/Distances/Accelerate/Distributional.hs
+9
-4
Utils.hs
src/Gargantext/Core/Methods/Matrix/Accelerate/Utils.hs
+25
-4
No files found.
src/Gargantext/Core/Methods/Distances/Accelerate/Distributional.hs
View file @
e510b73c
...
...
@@ -57,7 +57,7 @@ distributional'' :: ( P.Num (Exp a)
,
Elt
a
)
=>
Matrix
a
->
Matrix
a
distributional''
m'
=
run
$
mi
distributional''
m'
=
run
$
mi
_d_mi
where
m
=
use
m'
n
=
dim
m'
...
...
@@ -67,8 +67,13 @@ distributional'' m' = run $ mi
o_d_m
=
(
#*#
)
(
matrixOne
n
)
d_m
d_m_o
=
(
#*#
)
d_m
(
matrixOne
n
)
mi
=
(
.*
)
((
./
)
m
o_d_m
)
((
./
)
m
o_d_m
)
d_mi
=
(
.*
)
(
matrixIdentity
n
)
mi
mi_d_mi
=
(
.-
)
mi
d_mi
...
...
@@ -151,6 +156,6 @@ rIJ n m = matMiniMax $ divide a b
-- | Test perfermance with this matrix
-- TODO : add this in a benchmark folder
distriTest
::
Int
->
Matrix
Double
distriTest
n
=
distributional
(
theMatrix
n
)
distriTest
n
=
distributional
(
theMatrix
Int
n
)
src/Gargantext/Core/Methods/Matrix/Accelerate/Utils.hs
View file @
e510b73c
...
...
@@ -75,6 +75,27 @@ import Data.Array.Accelerate.LinearAlgebra hiding (Matrix, transpose, Vector)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
(
./
)
=
zipWith
(
/
)
(
.-
)
::
(
Shape
ix
,
Slice
ix
,
Elt
a
,
P
.
Num
(
Exp
a
)
,
P
.
Fractional
(
Exp
a
)
)
=>
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
(
.-
)
=
zipWith
(
-
)
(
.+
)
::
(
Shape
ix
,
Slice
ix
,
Elt
a
,
P
.
Num
(
Exp
a
)
,
P
.
Fractional
(
Exp
a
)
)
=>
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
(
.+
)
=
zipWith
(
+
)
-----------------------------------------------------------------------
matrixOne
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
...
...
@@ -364,11 +385,11 @@ p_ m = zipWith (/) m (n_ m)
) m
-}
theMatrix
'
::
Int
->
Matrix
Double
theMatrix
'
n
=
run
$
map
fromIntegral
(
use
$
theMatrix
n
)
theMatrix
Double
::
Int
->
Matrix
Double
theMatrix
Double
n
=
run
$
map
fromIntegral
(
use
$
theMatrixInt
n
)
theMatrix
::
Int
->
Matrix
Int
theMatrix
n
=
matrix
n
(
dataMatrix
n
)
theMatrix
Int
::
Int
->
Matrix
Int
theMatrix
Int
n
=
matrix
n
(
dataMatrix
n
)
where
dataMatrix
::
Int
->
[
Int
]
dataMatrix
x
|
(
P
.==
)
x
2
=
[
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