Commit f896b689 authored by josd's avatar josd

adding e:ccdTransform built-in to transform case control datamodels

parent 3ae6c7b3
EYE release
[v18.1222.2151] adding e:ccdTransform built-in to transform case control datamodels
[v18.1223.1233] adding e:ccdTransform built-in to transform case control datamodels
[v18.1214.1911] reintroducing --carl switch and original N3 parser
[v18.1130.1238] updating reasoning to always use PREFIX instead of @prefix
[v18.1123.1028] removing libgmp dependency
......
EYE v18.1222.2151 josd
EYE v18.1223.1233 josd
......@@ -36,7 +36,7 @@
:- set_prolog_flag(encoding, utf8).
:- endif.
version_info('EYE v18.1222.2151 josd').
version_info('EYE v18.1223.1233 josd').
license_info('MIT License
......@@ -5086,30 +5086,30 @@ djiti_assertz(A) :-
B
).
'<http://eulersharp.sourceforge.net/2003/03swap/log-rules#ccdTransform>'([A, B], [C, D]) :-
findall([E, F, G],
'<http://eulersharp.sourceforge.net/2003/03swap/log-rules#ccdTransform>'(A, [Y, Z]) :-
findall([F, G, H],
( length(A, I),
member([E, F, J, K], A),
member([F, G, J, K], A),
( J =:= 0
-> G is 1/(I*K)
-> H is -log(I)-log(K)
; ( K =:= 0
-> G is I*J
; G is J/K
-> H is log(I)+log(J)
; H is log(J)-log(K)
)
)
),
C
Y
),
findall(G,
( member([E, F, G], C)
findall(H,
( member([_, _, H], Y)
),
L
),
product(L, M),
sum(L, M),
length(L, N),
( N > 0
-> D is B*M**(1/N)/(1+B*M**(1/N))
; D is 0.5
-> Z is 1/(1+exp(-M/N))
; Z is 0.5
).
% DEPRECATED
......
No preview for this file type
#Processed by EYE v18.1222.1845 josd
#eye --nope --turtle http://josd.github.io/eye/reasoning/ccd/test_data.ttl --turtle http://josd.github.io/eye/reasoning/ccd/train_model.ttl --query http://josd.github.io/eye/reasoning/ccd/test_query.n3
#Processed by EYE v18.1222.2151 josd
#eye --nope --turtle http://josd.github.io/eye/reasoning/ccd/test_data.ttl --turtle http://josd.github.io/eye/reasoning/ccd/train_model.ttl --query test_query.n3
PREFIX : <http://josd.github.io/eye/reasoning#>
PREFIX list: <http://www.w3.org/2000/10/swap/list#>
......@@ -7,11 +7,11 @@ PREFIX math: <http://www.w3.org/2000/10/swap/math#>
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
_:t_0 :answer (:expected 1 :predicted 1 :belief 0.5614035087719298 :evidence ((:input1 "xyz" 2) (:input3 (0 1) 1) (:input4 :v4 1) (:input5 "b" 8))).
_:t_1 :answer (:expected 0 :predicted 0 :belief 0.7097616999440769 :evidence ((:input1 "abc" 0.6666666666666666) (:input2 60 0.5) (:input4 :v3 0.5) (:input5 "a" 1))).
_:t_2 :answer (:expected 1 :predicted 1 :belief 0.6264858150038726 :evidence ((:input1 "xyz" 2) (:input2 40 9) (:input5 "a" 1))).
_:t_3 :answer (:expected 0 :predicted 0 :belief 0.6884452465299415 :evidence ((:input3 (0 1) 1) (:input4 :v3 0.5))).
_:t_0 :answer (:expected 1 :predicted 1 :belief 0.6666666666666666 :evidence ((:input1 "xyz" 0.6931471805599453) (:input3 (0 1) 0.0) (:input4 :v4 0.0) (:input5 "b" 2.0794415416798357))).
_:t_1 :answer (:expected 0 :predicted 0 :belief 0.6101493074464512 :evidence ((:input1 "abc" -0.4054651081081645) (:input2 60 -0.6931471805599453) (:input4 :v3 -0.6931471805599453) (:input5 "a" 0.0))).
_:t_2 :answer (:expected 1 :predicted 1 :belief 0.7238134704678372 :evidence ((:input1 "xyz" 0.6931471805599453) (:input2 40 2.1972245773362196) (:input5 "a" 0.0))).
_:t_3 :answer (:expected 0 :predicted 0 :belief 0.5857864376269049 :evidence ((:input3 (0 1) 0.0) (:input4 :v3 -0.6931471805599453))).
#2018-12-22T21:49:20.878Z in=33 out=4 ent=0 step=0 brake=1 inf=31388 sec=0.088 inf/sec=356682
#2018-12-23T12:32:28.817Z in=33 out=4 ent=0 step=0 brake=1 inf=31743 sec=0.093 inf/sec=341323
#ENDS
......@@ -23,7 +23,7 @@ PREFIX : <http://josd.github.io/eye/reasoning#>
}
?CL
).
(?CL 0.64) e:ccdTransform (?E ?Q).
?CL e:ccdTransform (?E ?Q).
?SCOPE e:optional {
?Q math:greaterThan 0.5.
(?V ?B) log:equalTo (1 ?Q).
......
#Processed by EYE v18.1222.1845 josd
#Processed by EYE v18.1222.2151 josd
#eye --nope --turtle http://josd.github.io/eye/reasoning/ccd/train_data.ttl --n3 http://josd.github.io/eye/reasoning/ccd/train_rules.n3 --query http://josd.github.io/eye/reasoning/ccd/train_query.n3
PREFIX : <http://josd.github.io/eye/reasoning#>
......@@ -20,6 +20,6 @@ PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
(:input5 "c") :ccd (0 3).
(:input5 "a") :ccd (1 1).
#2018-12-22T21:49:20.225Z in=53 out=13 ent=13 step=82 brake=2 inf=32370 sec=0.091 inf/sec=355714
#2018-12-22T22:37:30.324Z in=53 out=13 ent=13 step=82 brake=2 inf=32367 sec=0.094 inf/sec=344330
#ENDS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment