| structure_learning.proposals.partition.partition_proposal |
index /Users/165421/Documents/code/structure_learning/src/structure_learning/proposals/partition/partition_proposal.py |
This module defines the PartitionProposal class, which implements various operations
for proposing modifications to partitions in a structure learning context.
Classes:
PartitionProposal: Implements operations such as swapping, splitting, merging,
and moving nodes between partitions.
Methods:
propose: Proposes a new state by applying one of the defined operations.
compute_acceptance_ratio: Computes the acceptance ratio for the proposed state.
get_nodes_to_rescore: Returns the nodes that need to be rescored.
accept: Accepts the proposed state and updates the current state.
compute_neighborhoods: Computes the number of neighborhoods for a given state.
_calculate_move_probs: Calculates probabilities for different moves.
_swap_adjacent: Swaps nodes between adjacent partitions.
_swap_global: Swaps nodes between non-adjacent partitions.
_split_or_merge_move: Performs either a split or merge operation.
_split_move: Splits a partition into two.
_join_move: Merges two adjacent partitions.
_node_to_existing_partition: Moves a node to an existing partition.
_node_to_new_partition: Moves a node to a new partition.
_move_node_to_existing_or_new_partition: Moves a node to either an existing or new partition.
_compute_neighborhoods_new_existing_partition: Computes neighborhoods for new and existing partitions.
_calculate_join_possibilities: Calculates join possibilities for nodes.
_calculate_partition_transitions: Calculates partition transition possibilities.
_possible_splits_joins: Calculates possible splits and joins.
_possible_permutations_neighbors: Calculates permutations for neighboring partitions.
_possible_permutations: Calculates permutations for all partitions.
| Modules | ||||||
| ||||||
| Classes | ||||||||||
|
| ||||||||||
| Data | ||
| List = typing.List | ||