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
153
Issues
153
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
51df3b7d
Commit
51df3b7d
authored
Mar 24, 2023
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OPTIM] Distri Similarity
parent
107b2fc6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
gargantext.cabal
gargantext.cabal
+1
-1
Similarities.hs
src/Gargantext/Core/Methods/Similarities.hs
+2
-2
Conditional.hs
...ntext/Core/Methods/Similarities/Accelerate/Conditional.hs
+0
-2
Distributional.hs
...xt/Core/Methods/Similarities/Accelerate/Distributional.hs
+10
-7
No files found.
gargantext.cabal
View file @
51df3b7d
...
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
name: gargantext
version: 0.0.6.9.8.1
version:
0.0.6.9.8.1
synopsis: Search, map, share
description: Please see README.md
category: Data
...
...
src/Gargantext/Core/Methods/Similarities.hs
View file @
51df3b7d
...
...
@@ -20,7 +20,7 @@ import Data.Swagger
import
Data.Text
(
Text
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Core.Methods.Similarities.Accelerate.Conditional
(
measureConditional
)
import
Gargantext.Core.Methods.Similarities.Accelerate.Distributional
(
logDistributional
)
import
Gargantext.Core.Methods.Similarities.Accelerate.Distributional
(
logDistributional
2
)
-- import Gargantext.Core.Text.Metrics.Count (coocOn)
-- import Gargantext.Core.Viz.Graph.Index
import
Gargantext.Prelude
(
Ord
,
Eq
,
Int
,
Double
,
Show
,
map
)
...
...
@@ -36,7 +36,7 @@ data Similarity = Conditional | Distributional
measure
::
Similarity
->
Matrix
Int
->
Matrix
Double
measure
Conditional
x
=
measureConditional
x
measure
Distributional
x
=
logDistributional
x
measure
Distributional
x
=
logDistributional
2
x
------------------------------------------------------------------------
withMetric
::
GraphMetric
->
Similarity
...
...
src/Gargantext/Core/Methods/Similarities/Accelerate/Conditional.hs
View file @
51df3b7d
...
...
@@ -92,5 +92,3 @@ conditional' m = ( run $ ie $ map fromIntegral $ use m
n
::
Exp
Double
n
=
P
.
fromIntegral
r
src/Gargantext/Core/Methods/Similarities/Accelerate/Distributional.hs
View file @
51df3b7d
...
...
@@ -137,8 +137,8 @@ import qualified Prelude
-- 8.333333333333333e-2, 4.6875e-2, 1.0, 0.25,
-- 0.3333333333333333, 5.7692307692307696e-2, 1.0, 1.0]
--
distributional
::
Matrix
Int
->
Acc
(
Matrix
Double
)
distributional
m'
=
result
distributional
::
Matrix
Int
->
Matrix
Double
distributional
m'
=
r
un
$
r
esult
where
m
=
map
A
.
fromIntegral
$
use
m'
n
=
dim
m'
...
...
@@ -170,7 +170,7 @@ distributional m' = result
logDistributional2
::
Matrix
Int
->
Matrix
Double
logDistributional2
m
=
trace
(
"logDistributional, dim="
`
mappend
`
show
n
)
.
run
$
diagNull
n
--
$ diagNull n
$
matMaxMini
$
logDistributional'
n
m
where
...
...
@@ -263,7 +263,7 @@ logDistributional' n m' = trace ("logDistributional'") result
--
logDistributional
::
Matrix
Int
->
Matrix
Double
logDistributional
m'
=
run
$
diagNull
n
result
logDistributional
m'
=
run
result
where
m
=
map
fromIntegral
$
use
m'
n
=
dim
m'
...
...
@@ -362,9 +362,12 @@ rIJ n m = matMaxMini $ divide a b
-- * For Tests (to be removed)
-- | Test perfermance with this matrix
-- TODO : add this in a benchmark folder
distriTest
::
Int
->
Matrix
Double
distriTest
n
=
logDistributional
(
theMatrixInt
n
)
{-
distriTest :: Int -> Bool
distriTest n = logDistributional m == distributional m
where
m = theMatrixInt n
-}
-- * sparse utils
...
...
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