Agents and LRNN in 2P-Kt
Online Report
Summary
This project goal is to add to 2P-Kt a module that provides an implementation of LRNN, this will be obtained by leveraging on the official implementation of LRNN, NeuraLogic, available in github.The expected deliverable is a module that uses existing modules of 2P-Kt to provide the description of a problem and then relies on NeuraLogic to construct the NNs, associated to the examples written with 2P-Kt, and to learn their weights through stochastic gradient descent.In order to reach this goal the project could be divided into the following steps:- Create classes/sub-types from interfaces of Fact and Rule to deal with weighted clauses
- Provide a way to save template, examples and queries in '.txt' files, using string formatter 2. Provide a way to create additional test queries and to use the learned weights to perform inference 2. Check template to avoid cycles
- Create a Solver that calls NeuraLogic with path to the files created in (2)
- Check queries in order to avoid using those not matched in the ground network (NeuraLogic stops with error)
NeuraLogic
As of 04/2020, commit: ac33e94Value Hierarchy
Value
Abstact class provided in package cz.cvut.fel.ida.algebra.values, implements IterableScalarValue
VectorValue
MatrixValue
One, Zero
ScalarValue constants used to make operations faster.TensorValue
This class is a work in progress.Weight
Provided in package cz.cvut.fel.ida.algebra.weights. It should be created via a factory.Term Hierarchy
Term
Provided in package cz.cvut.fel.ida.logic, implements SerializableVariable
Implements Term.Constant
Implements Term.Weighted Fact
Weighted Rule
Template Hierarchy
Template
Implements ModelNeuralizer
Implements exportable.NeuralProcessingSample
Extends NeuralSample (Defined in "Neural/src/main/java/cz/cvut/fel/ida/neural/networks/computation/training/NeuralSample.java")Query Hierarchy
Query
Abstract class, provided in package cz.cvut.fel.ida.learning, implements Exportable.QueryNeuron
Provided in package cz.cvut.fel.ida.neural.networks.structure.components.neurons, extends QueryModel Hierarchy
Interface Model
Provided in package cz.cvut.fel.ida.learning.NeuralModel
It is provided in package cz.cvut.fel.ida.neural.networks.computation.training and implements ModelNeuralSample
It is provided in package cz.cvut.fel.ida.neural.networks.computation.training and extends LearningSampleEnd2endTrainigBuilder
Provided in package cz.cvut.fel.ida.pipelines.building; Extends extends AbstractPipelineBuilderLRNN Module 2P-Kt
This module provides an interface between 2P-kt and NeuraLogic, in particular the classes FactProb and RuleProb can be used to go from 2P-kt's facts and rules to a format accepted by NeuraLogic, by associating them with weights and providing a way to create files in the format required by NeuraLogic's Pipelines.The class Sources is used to work with NeuraLogic's Sources and Settings, in order to change the parameters and the files to be used by the Pipeline. Activation is an enumeration class from which the user can choose the activation function to be used during training.More information are available in the README.md of the repository.LRNN Solver
Leverages on the CLI and Pipelines modules of NeuraLogic to provided learning and inference functions to users. An example of usage is provided in it.unibo.tuprolog.lrnn.Example.ktSources
Provided in package it.unibo.tuprolog.lrnn.sources.FactProb
Provided in package it.unibo.tuprolog.lrnn.clauses.RuleProb
Provided in package it.unibo.tuprolog.lrnn.clauses.Activation
Enum class provided in package it.unibo.tuprolog.lrnn.clauses.Repo