Skip to content

Commit

Permalink
Merge pull request #236 from PESchoenberg/develop
Browse files Browse the repository at this point in the history
Info updated.
  • Loading branch information
PESchoenberg committed Oct 15, 2022
2 parents 445199f + 4345488 commit 42612a4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 65 deletions.
2 changes: 1 addition & 1 deletion grsp11.scm
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
;; - p_b1: boolean.
;; - #t: shows element ordinals.
;; - #f: does not show ordinals.
;; - p_l1: list
;; - p_l1: list.
;;
(define (grsp-lal-dev p_b1 p_l1)
(let ((nh 0))
Expand Down
2 changes: 1 addition & 1 deletion grsp15.scm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
;; Parameters:
;; - p_x1: x.
;; - p_j1: j.
;; - p_a1: matrixwith data points.
;; - p_a1: matrix with data points.
;;
;; Sources:
;; - [3][4].
Expand Down
34 changes: 16 additions & 18 deletions grsp16.scm
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,22 @@
;; - p_l2: list of the exported functions as strings, i.e "grsp-reqmod"
;; "grsp-defmod"...
;;
(define (grsp-scm-defmod p_s1 p_l1 p_l2)
;;(let ((j2 1))

(display "(define-module ")
(display p_s1)
(displayl "\n #:use-module " p_l1)
(display "\n #:export ")
(display (list-ref p_l2 0))

(let loop ((j2 1))
(if (< j2 (length p_l2))
(begin (display "\n ")
(display (list-ref p_l2 j2))
(loop (+ j2 1)))))


(display "))")
(newline))
(define (grsp-scm-defmod p_s1 p_l1 p_l2)
(display "(define-module ")
(display p_s1)
(displayl "\n #:use-module " p_l1)
(display "\n #:export ")
(display (list-ref p_l2 0))

(let loop ((j2 1))
(if (< j2 (length p_l2))
(begin (display "\n ")
(display (list-ref p_l2 j2))
(loop (+ j2 1)))))


(display "))")
(newline))


;;;; grsp-scm-create-prg - Creates an .scm program file according to user
Expand Down
38 changes: 19 additions & 19 deletions grsp5.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@
;; Create results vector.
(set! res1 (grsp-matrix-create 0 1 5))

;; Q2
;; Q2.
(array-set! res1 (grsp-median1 res3) 0 2)
(set! res3 res6)

Expand All @@ -1414,10 +1414,10 @@
(set! n4 (+ ln2 (- ll1 2)))
(set! n5 (+ n4 2))))

;; Q1
;; Q1.
(array-set! res1 (grsp-median1 (grsp-matrix-subcpy res3 lm2 hm2 ln2 n4)) 0 1)

;; Q3
;; Q3.
(set! res3 res6)
(array-set! res1 (grsp-median1 (grsp-matrix-subcpy res3 lm2 hm2 n5 hn2)) 0 3)

Expand Down Expand Up @@ -1928,14 +1928,14 @@
(res3 0)
(res4 0))

;; res2
;; res2.
(set! res2 (/ 1 (* (grsp-complex-gamma p_b2 p_s1 p_k1 p_n1)
(expt p_t1 p_k1))))

;; res3
;; res3.
(set! res3 (expt p_x1 (- p_k1 1)))

;; res4
;; res4.
(set! res4 (expt (grsp-e) (* -1 (/ p_x1 p_t1))))

;; Compose results.
Expand Down Expand Up @@ -2003,14 +2003,14 @@
(res3 0)
(res4 0))

;; res2
;; res2.
(set! res2 (/ (expt p_b1 p_a1)
(grsp-complex-gamma p_b2 p_s1 p_a1 p_n1)))

;; res3
;; res3.
(set! res3 (expt p_x1 (- p_a1 1)))

;; res4
;; res4.
(set! res4 (expt (grsp-e) (* -1 p_b1 p_x1)))

;; Compose results.
Expand Down Expand Up @@ -2076,10 +2076,10 @@
(res2 0)
(res3 0))

;; res2
;; res2.
(set! res2 (/ 1 (grsp-complex-gamma p_b2 p_s1 p_k1 p_n1)))

;; res3
;; res3.
(set! res3 (grsp-complex-ligamma p_b2 p_s1 p_k1 (/ p_x1 p_t1) p_n1))

;; Compose results.
Expand Down Expand Up @@ -2144,10 +2144,10 @@
(res2 0)
(res3 0))

;; res2
;; res2.
(set! res2 (/ 1 (grsp-complex-gamma p_b2 p_s1 p_a1 p_n1)))

;; res3
;; res3.
(set! res3 (grsp-complex-ligamma p_b2 p_s1 p_a1 (* p_b1 p_x1) p_n1))

;; Compose results.
Expand Down Expand Up @@ -2450,13 +2450,13 @@
(res3 0)
(res4 0))

;; res2
;; res2.
(set! res2 (/ 1 (* p_x3 (sqrt (* 2 (grsp-pi))))))

;; res3
;; res3.
(set! res3 (* -0.5 (expt (/ (- p_x1 p_x2) p_x3) 2)))

;; res4
;; res4.
(set! res4 (expt (grsp-e) res3))

;; Compose results.
Expand Down Expand Up @@ -2532,13 +2532,13 @@
(res3 0)
(res4 0))

;; res2
;; res2.
(set! res2 (expt (/ p_x3 p_x4) 2))

;; res3
;; res3.
(set! res3 (/ (expt (- p_x2 p_x1) 2) (grsp-variance1 p_x4)))

;; res4
;; res4.
(set! res4 (* 2 (log (/ p_x4 p_x3))))

;; Compose results.
Expand Down
8 changes: 4 additions & 4 deletions grsp7.scm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
;;;; grsp-geo-triangle - Area of a triangle.
;;
;; Keywords:
;; - geometry.
;; - geometry, polygons.
;;
;; Parameters:
;; - p_x1: base.
Expand All @@ -122,7 +122,7 @@
;;;; grsp-geo-rectangle - Area of a rectangle.
;;
;; Keywords:
;; - geometry.
;; - geometry, polygons.
;;
;; Parameters:
;; - p_x1: base.
Expand Down Expand Up @@ -348,7 +348,7 @@
;; - geometry, conoids.
;;
;; Parameters:
;; - p_x1: x
;; - p_x1: x.
;; - p_y1: y.
;;
;; Sources:
Expand Down Expand Up @@ -388,7 +388,7 @@
;; - geometry, saddle, surface, hyperbolic, paraboloid.
;;
;; Parameters:
;; - p_x1: x
;; - p_x1: x.
;; - p_y1: y.
;;
;; Sources:
Expand Down
35 changes: 17 additions & 18 deletions grsp8.scm
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
;; weights, etc.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
;; Output:
;; - A list with elements combining the results provided by:
Expand Down Expand Up @@ -480,7 +480,7 @@
;; - p_n2: mutations desired after each iteration.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
;; Output:
;; - p_l1 updated.
Expand All @@ -502,7 +502,7 @@
(display s1)
(display i1)
(display "\n")))
;; ***

;; Evaluate nodes.
(set! res1 (grsp-ann-nodes-eval p_b3 res1))

Expand Down Expand Up @@ -638,7 +638,7 @@
;; - p_a3: count matrix.
;; - p_n1:
;; - 0: for nodes.
;; - 1: for conns
;; - 1: for conns.
;; - p_l2: list containing the values for the matrix row.
;;
;; Notes:
Expand Down Expand Up @@ -767,7 +767,7 @@
;; - functions, ann, neural network.
;;
;; Parameters:
;; - p_d1: database name
;; - p_d1: database name.
;; - p_l1: ann.
;;
;; Output:
Expand Down Expand Up @@ -817,7 +817,7 @@
;; - functions, ann, neural network.
;;
;; Parameters:
;; - p_d1: database name
;; - p_d1: database name.
;; - p_l1: ann.
;;
;; Output:
Expand Down Expand Up @@ -992,7 +992,6 @@
0
l1))))

;;(grsp-ann-counter-upd count 0)
(set! c0 (array-ref count 0 0))

(set! i2 (in i2)))
Expand Down Expand Up @@ -1135,7 +1134,7 @@
;; Calculate number of rows based on total number of ann layers.
(set! m1 (+ 2 p_nm))

;; Create empty matrix
;; Create empty matrix.
(set! res1 (grsp-matrix-create 0 m1 n1))

;; Extract the boundaries of the matrix.
Expand Down Expand Up @@ -1545,7 +1544,7 @@
;; Prepare data for activation function.
(set! n5 (array-ref res1 0 5)) ;; Bias.
(set! n7 (array-ref res1 0 7)) ;; Associated function.
(set! n9 (array-ref res1 0 9)) ;; Weight. (was elem 7)
(set! n9 (array-ref res1 0 9)) ;; Weight (was elem 7).

;; Set activation function input value.
(set! n6 (* (+ n6 n9) n5))
Expand Down Expand Up @@ -1753,7 +1752,7 @@
(display "\n ++ 1.1 Node number ")
(display id)
(display "\n")))
;; ***

(grsp-ann-node-eval p_b3 id nodes conns count)
(set! res3 (grsp-ann-node-eval p_b3 id nodes conns count))

Expand Down Expand Up @@ -2359,7 +2358,7 @@
(set! odata (grsp-matrix-row-subrepal odata m3 (list 0 0 0 0)))

;; Fill data.
(array-set! odata (array-ref res2 i2 0) m3 0) ;; id
(array-set! odata (array-ref res2 i2 0) m3 0) ;; id.
(array-set! odata (array-ref res2 i2 3) m3 1) ;; layer.
(array-set! odata (array-ref res2 i2 4) m3 2) ;; layer pos.
(array-set! odata (array-ref res2 i2 6) m3 3) ;; output value col.
Expand Down Expand Up @@ -2556,7 +2555,7 @@
;; - See grsp-m2datai.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
;; Output:
;; - p_l1 with an updated datai table.
Expand Down Expand Up @@ -2732,7 +2731,7 @@
;; - See grsp3.grsp-matrix-fdifm, grsp-ann-fdifm.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
;; Output:
;; - A list containing difference maps (matrices) for each pair of ann matrices;
Expand Down Expand Up @@ -2951,7 +2950,7 @@
(set! i2 lm2)
(while (<= i1 hm1)

;; Add a row in res2
;; Add a row in res2.
(set! res2 (grsp-matrix-subexp res2 1 0))
(set! hm2 (grsp-matrix-esi 2 res2))

Expand Down Expand Up @@ -3414,7 +3413,7 @@
;; - p_l1: ann.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
(define (grsp-ann-devt p_b1 p_l1)
(let ((l2 '()))
Expand Down Expand Up @@ -3626,10 +3625,10 @@
;; - 2: describe only output connections.
;;
;; Notes:
;; - See grsp-ann-devnc
;; - See grsp-ann-devnc.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
(define (grsp-ann-devnca p_b1 p_b3 p_l1 p_n2)
(let ((i1 0)
Expand Down Expand Up @@ -3669,7 +3668,7 @@
;; p_l1: ann.
;;
;; Examples:
;; - example3.scm
;; - example3.scm.
;;
(define (grsp-ann-stats p_s1 p_l1)
(let ((size 0)
Expand Down
8 changes: 4 additions & 4 deletions grsp9.scm
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@
;;
;; Parameters:
;; - p_a1: 1 x n vector with n elements, representing an n-dimensinal problem.
;; [-5.0, +5.0]
;; [-5.0, +5.0].
;;
;; Sources:
;; - [1].
Expand Down Expand Up @@ -1185,8 +1185,8 @@

;;;; grsp-cop-rosenbrock1 - Rosenbrock test, constrained objective function
;; (cube, line). Returns +nan.0 for unconstraied arguments.
;; - (p_x1 - 1)**3 - p_y1 + 1 <= 0
;; - p_x1 = p_y1 - 2 <= 0
;; - (p_x1 - 1)**3 - p_y1 + 1 <= 0.
;; - p_x1 = p_y1 - 2 <= 0.
;;
;; Keywords:
;; - functions, test, optimization, artificial, landscape.
Expand Down Expand Up @@ -1220,7 +1220,7 @@

;;;; grsp-cop-rosenbrock2 - Rosenbrock test, constrained objective function
;; (disk). Returns +nan.0 for unconstraied arguments.
;; - p_x1**2 + p_y1**2 <= 2
;; - p_x1**2 + p_y1**2 <= 2-
;;
;; Keywords:
;; - functions, test, optimization, artificial, landscape.
Expand Down

0 comments on commit 42612a4

Please sign in to comment.