neuralogic.core.constructs

Submodules

neuralogic.core.constructs.factories

class AtomFactory[source]

Bases: object

class Predicate(hidden=False, special=False)[source]

Bases: object

get(name: str) BaseRelation[source]
static get_predicate(name, arity, hidden, special) Predicate[source]
property hidden: Predicate
property special: Predicate
get(name: str) BaseRelation[source]
class ConstantFactory[source]

Bases: object

get(item: str) str[source]
class VariableFactory[source]

Bases: object

get(item: str) str[source]

neuralogic.core.constructs.function

class Aggregation(name: str)[source]

Bases: Function

AVG: Aggregation = <neuralogic.core.constructs.function.function.Aggregation object>
CONCAT: Aggregation = <neuralogic.core.constructs.function.concat.Concat object>
COUNT: Aggregation = <neuralogic.core.constructs.function.function.Aggregation object>
MAX: Aggregation = <neuralogic.core.constructs.function.function.Aggregation object>
MIN: Aggregation = <neuralogic.core.constructs.function.function.Aggregation object>
SOFTMAX: Aggregation = <neuralogic.core.constructs.function.softmax.Softmax object>
SUM: Aggregation = <neuralogic.core.constructs.function.function.Aggregation object>
name: str
class Combination(name: str)[source]

Bases: Function

AVG: Combination = <neuralogic.core.constructs.function.function.Combination object>
CONCAT: Combination = <neuralogic.core.constructs.function.concat.ConcatComb object>
COSSIM: Combination = <neuralogic.core.constructs.function.function.Combination object>
COUNT: Combination = <neuralogic.core.constructs.function.function.Combination object>
CROSSSUM: Combination = <neuralogic.core.constructs.function.function.Combination object>
ELPRODUCT: Combination = <neuralogic.core.constructs.function.function.Combination object>
MAX: Combination = <neuralogic.core.constructs.function.function.Combination object>
MIN: Combination = <neuralogic.core.constructs.function.function.Combination object>
PRODUCT: Combination = <neuralogic.core.constructs.function.function.Combination object>
SOFTMAX: Combination = <neuralogic.core.constructs.function.function.Combination object>
SPARSEMAX: Combination = <neuralogic.core.constructs.function.function.Combination object>
SUM: Combination = <neuralogic.core.constructs.function.function.Combination object>
name: str
class Function(name: str)[source]

Bases: object

get()[source]
is_parametrized() bool[source]
name: str
pretty_str() str[source]
process_head(head) Function[source]
rule_head_dependant() bool[source]
wrap(content: str) str[source]
class Transformation(name: str)[source]

Bases: Function

EXP: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
IDENTITY: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
INVERSE: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
LEAKY_RELU: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
LOG: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
LUKASIEWICZ: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
NORM: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
RELU: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
RESHAPE: Transformation = <neuralogic.core.constructs.function.reshape.Reshape object>
REVERSE: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
SIGMOID: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
SIGNUM: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
SLICE: Transformation = <neuralogic.core.constructs.function.slice.Slice object>
SOFTMAX: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
SPARSEMAX: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
SQRT: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
TANH: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
TRANSP: Transformation = <neuralogic.core.constructs.function.function.Transformation object>
name: str

neuralogic.core.constructs.java_objects

class JavaFactory(settings: SettingsProxy | None = None)[source]

Bases: object

add_metadata_function(metadata, map, function: str)[source]
add_parametrized_function(metadata, metadata_obj, function: str)[source]
atom_to_clause(atom)[source]
get_conjunction(relations, variable_factory, default_weight=None, is_example=False)[source]
get_generic_relation(relation_class, relation, variable_factory, default_weight=None, is_example=False)[source]
get_lifted_example(example, learnable_facts=False)[source]
get_metadata(metadata, metadata_class)[source]
get_new_weight_factory()[source]
get_predicate(predicate)[source]
get_predicate_metadata_pair(predicate_metadata)[source]
get_query(query)[source]
get_relation(relation, variable_factory, is_example=False)[source]
get_rule(rule)[source]
get_term(term, variable_factory)[source]
get_valued_fact(relation, variable_factory, default_weight=None, is_example=False)[source]
get_variable_factory()[source]
get_weight(weight, name, fixed)[source]
class ValueFactory[source]

Bases: object

static from_java(value, number_format)[source]
get_value(weight)[source]

neuralogic.core.constructs.metadata

class Metadata(learnable: bool = None, transformation: str | Transformation | Combination = None, combination: str | Combination = None, aggregation: str | Aggregation = None, duplicit_grounding: bool | None = None)[source]

Bases: object

aggregation
combination
copy() Metadata[source]
duplicit_grounding
static from_iterable(iterable: Iterable) Metadata[source]
learnable
transformation

neuralogic.core.constructs.predicate

class Predicate(name, arity, hidden=False, special=False)[source]

Bases: object

arity
hidden
name
set_arity(arity)[source]
special
to_str()[source]
class PredicateMetadata(predicate: Predicate, metadata: Metadata)[source]

Bases: object

metadata
predicate

neuralogic.core.constructs.relation

class BaseRelation(predicate: Predicate, terms=None, function: Transformation | Combination = None, negated: bool = False)[source]

Bases: object

property T: BaseRelation
attach_activation_function(function: Transformation | Combination)[source]
function
negated
predicate
terms
to_str(end=False) str[source]
class WeightedRelation(weight, predicate: Predicate, fixed=False, terms=None, function: Transformation | Combination = None)[source]

Bases: BaseRelation

property T: WeightedRelation
attach_activation_function(function: Transformation | Combination)[source]
fixed() WeightedRelation[source]
is_fixed
to_str(end=False)[source]
weight
weight_name

neuralogic.core.constructs.rule

class Rule(head, body)[source]

Bases: object

body
head
is_ellipsis_templated() bool[source]
metadata: Metadata | None
to_str(_: bool = False) str[source]
class RuleBody(lit1, lit2)[source]

Bases: object

literals
metadata