Closed Habush closed 4 years ago
Hi, OK, for starters, consult the documentation:
,d make-afunc-cache
or
,describe make-afunc-cache
which explains that, given a function, returns a caching version of that function. (But it works only for functions that can take one Atom as the argument) It is the non-thread-safe variant of memoize-function-call
function .. which also has documentation.
The fix, for you is this:
(define-public cache-find-ggi (memoize-function-call do-find-ggi))
So ... now cache-find-ggi
is a function . that takes one atom as argument, and returns the same thing that do-find-ggi
would have returned.
BTW, are you using cytopscape for visualization, or gephi? I've started writing a export-to-gml function, so that I can use these to visualize some of the graphs... but it occurs to me that it would be nice to have a generic atomspace-to-js plugin that could work with cytoscape ...
Thanks @linas! It works now.
BTW, are you using cytopscape for visualization, or gephi?
We are using cytoscape for visualization. But the issue with cytoscape is its performance over large graphs, even those with 1000 nodes. And most of the results returned from the service have 1000+ nodes and 2000+ edges and cytoscape has been performing poorly. I recently discovered ngraph and it is crazy fast! Check out the benchmark video on the README. It is also has path search algorithms and clustering algorithms (which we are implementing manually in cytoscape). The downside maybe it requires you to do a bit of extra groundwork (like rendering the graph yourself) but tbf that isn't much compared to the performance gain.
EDIT:
It also supports gephi and DOT file serialization
Hi @linas, I am adding new functions to support STRING and I'm trying to use the caching utitlity function you added, i.e
memoize-function-call
. However, instead of the returning a result, it is returning a procedure that accepts a single atom. Here is the code I wroteNow, calling
(cache-find-ggi (Set (Gene "A") (List (Concept "B"))))
returns a procedure instead of the result ofdo-find-ggi
. What is missing here?