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
165
Issues
165
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
Hide 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,17 +57,22 @@ distributional'' :: ( P.Num (Exp a)
...
@@ -57,17 +57,22 @@ distributional'' :: ( P.Num (Exp a)
,
Elt
a
,
Elt
a
)
)
=>
Matrix
a
->
Matrix
a
=>
Matrix
a
->
Matrix
a
distributional''
m'
=
run
$
mi
distributional''
m'
=
run
$
mi
_d_mi
where
where
m
=
use
m'
m
=
use
m'
n
=
dim
m'
n
=
dim
m'
d_m
=
(
.*
)
(
matrixIdentity
n
)
m
d_m
=
(
.*
)
(
matrixIdentity
n
)
m
o_d_m
=
(
#*#
)
(
matrixOne
n
)
d_m
o_d_m
=
(
#*#
)
(
matrixOne
n
)
d_m
d_m_o
=
(
#*#
)
d_m
(
matrixOne
n
)
d_m_o
=
(
#*#
)
d_m
(
matrixOne
n
)
mi
=
(
.*
)
((
./
)
m
o_d_m
)
((
./
)
m
o_d_m
)
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
...
@@ -151,6 +156,6 @@ rIJ n m = matMiniMax $ divide a b
-- | Test perfermance with this matrix
-- | Test perfermance with this matrix
-- TODO : add this in a benchmark folder
-- TODO : add this in a benchmark folder
distriTest
::
Int
->
Matrix
Double
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)
...
@@ -75,6 +75,27 @@ import Data.Array.Accelerate.LinearAlgebra hiding (Matrix, transpose, Vector)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
->
Acc
(
Array
((
ix
:.
Int
)
:.
Int
)
a
)
(
./
)
=
zipWith
(
/
)
(
./
)
=
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
)
matrixOne
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
...
@@ -364,11 +385,11 @@ p_ m = zipWith (/) m (n_ m)
...
@@ -364,11 +385,11 @@ p_ m = zipWith (/) m (n_ m)
) m
) m
-}
-}
theMatrix
'
::
Int
->
Matrix
Double
theMatrix
Double
::
Int
->
Matrix
Double
theMatrix
'
n
=
run
$
map
fromIntegral
(
use
$
theMatrix
n
)
theMatrix
Double
n
=
run
$
map
fromIntegral
(
use
$
theMatrixInt
n
)
theMatrix
::
Int
->
Matrix
Int
theMatrix
Int
::
Int
->
Matrix
Int
theMatrix
n
=
matrix
n
(
dataMatrix
n
)
theMatrix
Int
n
=
matrix
n
(
dataMatrix
n
)
where
where
dataMatrix
::
Int
->
[
Int
]
dataMatrix
::
Int
->
[
Int
]
dataMatrix
x
|
(
P
.==
)
x
2
=
[
1
,
1
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