| | |
- structure_learning.proposals.proposal.StructureLearningProposal(abc.ABC)
-
- GraphProposal
class GraphProposal(structure_learning.proposals.proposal.StructureLearningProposal) |
| |
GraphProposal(initial_state: Union[numpy.ndarray, networkx.classes.digraph.DiGraph, structure_learning.data_structures.dag.DAG], blacklist=None, whitelist=None, seed: int = 32)
Graph Proposal by adding, deleting, reversing edges. |
| |
- Method resolution order:
- GraphProposal
- structure_learning.proposals.proposal.StructureLearningProposal
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, initial_state: Union[numpy.ndarray, networkx.classes.digraph.DiGraph, structure_learning.data_structures.dag.DAG], blacklist=None, whitelist=None, seed: int = 32)
- Initialise GraphProposal instance.
Parameters:
initial_state (networkx.DiGraph | numpy.ndarray): graph
blacklist (numpy.ndarray): mask for edges to ignore in the proposal
whitelist (numpy.ndarray): mask for edges to include in the proposal
- compute_acceptance_ratio(self, current_state_score, proposed_state_score, current_state_prior=0, proposed_state_prior=0)
- Calculate log acceptance ratio.
Returns:
(float)
- get_nodes_to_rescore(self) -> List[str]
- propose(self)
- Propose a DAG.
Returns:
(numpy.ndarray): adjacency matrix of proposed graph
(str): operation that generated the proposed graph
Data and other attributes defined here:
- ADD_EDGE = 'add_edge'
- DELETE_EDGE = 'delete_edge'
- REVERSE_EDGE = 'reverse_edge'
- __abstractmethods__ = frozenset()
- operations = ['add_edge', 'delete_edge', 'reverse_edge', 'stay_still']
Methods inherited from structure_learning.proposals.proposal.StructureLearningProposal:
- accept(self)
Data descriptors inherited from structure_learning.proposals.proposal.StructureLearningProposal:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes inherited from structure_learning.proposals.proposal.StructureLearningProposal:
- INITIAL = 'initial'
- STAY_STILL = 'stay_still'
| |