gustiks / neuralogic Goto Github PK
View Code? Open in Web Editor NEWDeep relational learning through differentiable logic programming.
License: MIT License
Deep relational learning through differentiable logic programming.
License: MIT License
ScalarValue::toString()
formats the value to 10 decimal places (Settings.detailedNumberFormat
).VectorValue::toSring()
formats the value to 2 decimal places (Settings.shortNumberFormat
).MatrixValue::toString()
does not use number formatter - formats numbers to 16 decimal places.One::toString()
formats the value to 0 decimal places.Zero::toString()
formats the value to 0 decimal places.This behavior results in inconsistent numbers rendering and larger rendered graphs (because matrices strings are too wide).
The drawing/rendering looks like it is supposed to be customizable via Drawer.numberFormat
property, but this property is not used anywhere.
At least non-constant values (Scalar, Vector, and Matrix) use the same (parametrized) number formatter.
The SoftEntropy error function produces NaN values for higher input values.
I identified problems in three different places:
Softmax computation https://github.com/GustikS/NeuraLogic/blob/master/Algebra/src/main/java/cz/cvut/fel/ida/algebra/functions/specific/SoftEntropy.java#L75
Math.exp
goes to infinity - should be fixable with exp(input[i] - max(input))
Scalar softentropy - https://github.com/GustikS/NeuraLogic/blob/master/Algebra/src/main/java/cz/cvut/fel/ida/algebra/functions/specific/SoftEntropy.java#L33
Math.exp
goes to infinity
Vector softentropy -
https://github.com/GustikS/NeuraLogic/blob/master/Algebra/src/main/java/cz/cvut/fel/ida/algebra/functions/specific/SoftEntropy.java#L47
Math.log
goes to -Infinity for zero and multiplication with zero targets results into NaN
VectorValue in = new VectorValue(
new double[] {
19056.858719905307, 4960.272544490949, 11971.046875371912,
5381.27145922252, 12381.873594408318, 4820.585859773736
}
);
VectorValue target = new VectorValue(new double[] {0, 0, 0, 0, 0, 1});
System.out.println(new SoftEntropy().evaluate(in, target));
System.out.println(new SoftEntropy().differentiate(in, target));
Outputs:
NaN
[NaN,NaN,NaN,NaN,NaN,NaN]
Is this nice library available as via some Maven Repository?
If not, may I suggest to consider using one othe following?
This would greatly impact the re-usability of you library, IMHO.
The Value::compareTo
violates the transitivity contract. For example:
VectorValue a = new VectorValue(new double[]{0.047629895714159626, 0.047604189443657435, 0.04854122567285466, 0.04761906321919965, 0.04738330389768908, 0.048210586527278, 0.047356453205930266, 0.04779385977269353, 0.04749880890690395, 0.049574893497338526, 0.0473965862144424, 0.04752080406323121, 0.05822692203068567, 0.04901807601925808, 0.04765455362607377, 0.05002604412125539, 0.05739356645498594, 0.047385976587184166, 0.0688271909926611, 0.047338000032517556});
VectorValue b = new VectorValue(new double[]{0.05230714877347989, 0.04768642416075893, 0.04828379450589333, 0.04748746042330981, 0.047413899100790274, 0.0480960111883369, 0.04760666402944034, 0.04780428311901668, 0.04741611488536501, 0.048049785025318044, 0.06407256569995881, 0.04745754447958131, 0.05822264359013865, 0.04743569428412833, 0.05136507865966237, 0.050132734147586, 0.04761751121968647, 0.05404798031492382, 0.0481002774579048, 0.04939638493472022});
VectorValue c = new VectorValue(new double[]{0.047687861504175824, 0.04853932979708919, 0.05375328444286901, 0.06789273268891113, 0.04752737473067581, 0.04765000054474707, 0.04752381588854653, 0.05315426060101445, 0.04825011418905211, 0.048603366978242836, 0.0482348444133695, 0.04745493855841848, 0.05201354770686542, 0.048210370136723586, 0.04875627392006865, 0.048451973613676286, 0.04850025765899207, 0.048359046978719435, 0.05203654183998997, 0.047400063807852756});
System.out.println("A B " + a.compareTo(b)); // Outputs 0 - A == B
System.out.println("B C " + b.compareTo(c)); // Outputs 0 - B == C
System.out.println("A C " + a.compareTo(c)); // Outputs -1 - A < C
This becomes an issue when I want to assign VectorValue as a label for a query (for example, in the case of clutrr). There is sorting of a collection of result (Vector) values happening here, which requires transitivity property and crashes NeuraLogic (does not happen in the Python frontend, as this part is not used).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.