OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-matrix commits / 7ac0fbe

Remove more obsolete API usages
7ac0fbe6985a1d816da8ddff02361130a15f7027
by Linas Vepštas <linasvepstas@gmail.com> · 2025-10-10T15:04:07.000Z

Changed files (3) +9 -15

opencog/matrix/compute-mi.scm +2 -2
……@@ -92,8 +92,8 @@
9292; fetched with the 'left-count and 'right-count methods on the
9393; support-api object. The value for N(*,*) can be gotten with the
9494; 'wild-wild-count method. More correctly, there are two of these
95; totals, which should differ only by rounding errors: they differ in
96; the order in which the sums are performed.
95; totals, which should not differ, or differ only by rounding errors:
96; these two differ in the order in which the sums are performed.
9797;
9898; The fractional mutual information for the pair (x,y) is defined with
9999; a plus sign, as in Deniz Yuret's thesis (1998, page 40):
opencog/matrix/frequency.scm +2 -2
……@@ -403,7 +403,7 @@
403403 'cache-all -- Do all three of the above.
404404"
405405 ; We need 'left-basis, provided by add-pair-stars
406 ; We need 'wild-wild-count, provided by add-support-api
406 ; We need 'total-sum-left and right, provided by add-support-api
407407 ; We need 'set-left-wild-freq, provided by add-pair-freq-api
408408 (define supobj (add-support-api LLOBJ))
409409 (define frqobj (add-pair-freq-api LLOBJ))
……@@ -411,7 +411,7 @@
411411 (define tot-cnt #f)
412412
413413 (define (init)
414 (set! tot-cnt (supobj `wild-wild-count)))
414 (set! tot-cnt (supobj `total-sum-left)))
415415
416416 ; Compute the pair frequency P(x,y) = N(x,y) / N(*,*) This is
417417 ; the frequency with which the pair (x,y) is observed. Return
opencog/matrix/report-api.scm +5 -11
……@@ -35,7 +35,7 @@
3535 'right-dim -- The number of columns
3636 'num-pairs -- The number of non-zero entries
3737 'total-count -- Total number of observations on all pairs
38 (Identical to the 'wild-wild-count on the
38 (Identical to the 'total-sum-left on the
3939 support-api object)
4040
4141 'left-entropy -- The sum H_left = -sum_y P(*,y) log_2 P(*,y)
……@@ -220,7 +220,7 @@
220220 (cog-value-ref (cog-value wild-atom r-norm-key) 3))
221221
222222 ; ----------------------------------------------------
223 (define (get-total-count) (supobj 'wild-wild-count))
223 (define (get-total-count) (supobj 'total-sum-left))
224224
225225 ;-------------------------------------------
226226
……@@ -339,10 +339,7 @@
339339 0.0
340340 (wild-obj 'left-basis)))
341341
342 ; TODO - some future day, use 'total-count-right
343 ; For now, too many existing datasets don't store this value.
344 ; (define total (len-obj 'total-count-right))
345 (define total (len-obj 'wild-wild-count))
342 (define total (len-obj 'total-sum-right))
346343
347344 (/ weighted-avg total))
348345
……@@ -364,10 +361,7 @@
364361 0.0
365362 (wild-obj 'right-basis)))
366363
367 ; TODO - some future day, use 'total-count-left
368 ; For now, too many existing datasets don't store this value.
369 ; (define total (len-obj 'total-count-left))
370 (define total (len-obj 'wild-wild-count))
364 (define total (len-obj 'total-sum-left))
371365
372366 (/ weighted-avg total))
373367
……@@ -659,7 +653,7 @@
659653 (format PORT "Error: left and right total pairs not equal! ~A ~A\n"
660654 lsize rsize))
661655
662 ; lobs should equal robs should equal (sup-obj 'wild-wild-count)
656 ; lobs should equal robs should equal (sup-obj 'total-sum-left)
663657 (if (not (equal? nlobs nrobs))
664658 (format PORT "Error: left and right total counts not equal! ~A ~A\n"
665659 lobs robs))