gaia.core.integrated_structures module

GAIA Integrated Structures

This module integrates fuzzy sets, simplicial sets, and coalgebras into a unified system following the abstractions defined in abstractions.py.

Combines functionality from: - fuzzy.py (fuzzy sets and membership functions) - simplices.py (simplicial structures) - coalgebras.py (F-coalgebras and endofunctors) - functor.py (simplicial functors)

class gaia.core.integrated_structures.TConorm(value)[source]

Bases: Enum

T-conorms for fuzzy set operations.

MAXIMUM = 'maximum'
PROBABILISTIC = 'probabilistic'
LUKASIEWICZ = 'lukasiewicz'
apply(a, b)[source]

Apply the t-conorm operation.

classmethod __contains__(member)

Return True if member is a member of this enum raises TypeError if member is not an enum member

note: in 3.12 TypeError will no longer be raised, and True will also be returned if member is the value of a member in this enum

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

class gaia.core.integrated_structures.FuzzyElement(element, membership)[source]

Bases: object

Element with fuzzy membership degree.

element: Any
membership: float
__init__(element, membership)
class gaia.core.integrated_structures.IntegratedFuzzySet(elements, membership_fn, name='fuzzy_set')[source]

Bases: GAIAComponent

Integrated fuzzy set implementing sheaf structure on [0,1].

__init__(elements, membership_fn, name='fuzzy_set')[source]
initialize()[source]

Initialize fuzzy set by computing membership for all elements.

update(state)[source]

Update fuzzy set based on training state.

validate()[source]

Validate fuzzy set properties.

get_membership(element)[source]

Get membership degree for element.

support()[source]

Return support set {x | μ(x) > 0}.

alpha_cut(alpha)[source]

Return α-cut {x | μ(x) ≥ α}.

merge_with(other, t_conorm=TConorm.MAXIMUM)[source]

Merge with another fuzzy set using t-conorm.

class gaia.core.integrated_structures.IntegratedSimplex(dimension, name, components=None, membership=1.0, payload=None)[source]

Bases: SimplicialStructure

Integrated simplex with fuzzy membership and categorical structure.

__init__(dimension, name, components=None, membership=1.0, payload=None)[source]
property dimension: int

Dimension of the simplex.

face_map(i)[source]

Apply i-th face map δᵢ with membership coherence.

degeneracy_map(i)[source]

Apply i-th degeneracy map σᵢ preserving membership.

verify_simplicial_identities()[source]

Verify simplicial identities hold.

classmethod __class_getitem__(params)

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….

class gaia.core.integrated_structures.IntegratedFuzzySimplicialSet(name, max_dimension=3)[source]

Bases: GAIAComponent

Integrated fuzzy simplicial set combining fuzzy and simplicial structures.

__init__(name, max_dimension=3)[source]
initialize()[source]

Initialize all fuzzy sets.

update(state)[source]

Update fuzzy simplicial set based on training state.

validate()[source]

Validate fuzzy simplicial set properties.

add_simplex(dimension, simplex_data, membership=1.0)[source]

Add a simplex with given membership.

get_membership(dimension, simplex_data)[source]

Get membership degree for a simplex.

merge_with(other, t_conorm=TConorm.MAXIMUM)[source]

Merge with another fuzzy simplicial set.

class gaia.core.integrated_structures.IntegratedCoalgebra(initial_state, endofunctor, name='coalgebra')[source]

Bases: Coalgebra[<MockTorch name=’mock.Tensor’ id=’4349657872’>], GAIAComponent

Integrated coalgebra for GAIA training dynamics.

__init__(initial_state, endofunctor, name='coalgebra')[source]
initialize()[source]

Initialize coalgebra.

update(state)[source]

Update coalgebra with new training state.

validate()[source]

Validate coalgebra properties.

is_bisimilar(other, relation)[source]

Check bisimilarity with another coalgebra.

iterate_dynamics(steps)[source]

Iterate coalgebra dynamics for multiple steps.

classmethod __class_getitem__(params)

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo(Generic[T]): ….

evolve(state)

Evolve state using structure map: γ(state).

gaia.core.integrated_structures.create_fuzzy_simplex(dimension, name, membership=1.0)[source]

Create a fuzzy simplex with given properties.

gaia.core.integrated_structures.create_fuzzy_simplicial_set_from_data(data, k=5, name='data_fss')[source]

Create fuzzy simplicial set from point cloud data using k-NN.

gaia.core.integrated_structures.merge_fuzzy_simplicial_sets(*fss_list, t_conorm=TConorm.MAXIMUM)[source]

Merge multiple fuzzy simplicial sets.