Ewerton-Vieira / MORALS

Official Repository for MORALS: Morse Graph-aided discovery of Regions of Attraction in a learned Latent Space
MIT License
6 stars 1 forks source link

Missing Adjacency Lists for Nodes in RoA Computation #1

Open ds257 opened 1 month ago

ds257 commented 1 month ago

Dear authors,

I am encountering an issue during the computation of Regions of Attraction (RoA) while using the MORALS framework, specifically with the dytop package. The issue arises when certain nodes in the Morse Graph are missing from the adjacency list, causing an error during the propagate function in RoA.py and ancestors function in Poset.py.

Here is a summary of the error trace:

  File "/opt/anaconda3/lib/python3.12/site-packages/dytop/RoA.py", line 117, in assign_morse_nodes2tiles
    morse_node = self.propagate(v, self.map_graph.adjacencies(v))
  File "/opt/anaconda3/lib/python3.12/site-packages/dytop/RoA.py", line 97, in propagate
    max = list(self.MG.maximal(adjacencies_morse_node - {-1}))
  File "/opt/anaconda3/lib/python3.12/site-packages/dytop/Poset.py", line 122, in maximal
    return frozenset({v for v in subset if not any(self.less(v, u) for u in subset)})
  File "/opt/anaconda3/lib/python3.12/site-packages/dytop/Poset.py", line 116, in less
    return v in self.ancestors(u)
  File "/opt/anaconda3/lib/python3.12/site-packages/dytop/Poset.py", line 75, in ancestors
    return self.ancestors_.adjacencies(v)
  File "/opt/anaconda3/lib/python3.12/site-packages/pychomp/DirectedAcyclicGraph.py", line 66, in adjacencies
    return self.adjacency_lists_[v]

I’ve attempted to add logging and handle missing adjacencies gracefully, but the missing nodes appear to be critical for the graph structure. Could you provide guidance on how to resolve this issue or suggest any changes to ensure the computation continues even with missing adjacencies?

Steps to Reproduce:

  1. Prepare the Dataset:

    • Ensure the pendulum_lqr1k dataset is downloaded and placed inside the examples/data/ directory as follows:
      examples/data/pendulum_lqr1k/
      examples/data/pendulum_lqr1k_success.txt
    • These files should contain the dataset and success labels, respectively.
  2. Train the Autoencoder and Latent Dynamics Networks:** Run the following command to train the models with the Pendulum LQR dataset:

    python train.py --config pendulum_lqr.txt
  3. Compute the Morse Graph and Regions of Attraction (RoA): After training, run the following command to compute the Morse Graph and RoA:

    python get_MG_RoA.py --config pendulum_lqr.txt --name_out pendulum_lqr --RoA --sub 16
  4. Observe the Error: The issue occurs during the RoA computation when certain nodes in the Morse Graph are not found in the adjacency list. The error trace points to the propagation function in RoA.py and Poset.py, where nodes are missing from the graph structure.

Environment:

Best regards,
Diya Saraf

aravindsiv commented 1 month ago

Hi Diya,

Thanks for your interest in our work. Pinging @Ewerton-Vieira since he is one of the developers of dytop.

Ewerton-Vieira commented 1 month ago

Hi Diya,

MORALS works for non-stochastic systems, so if you try to use it for a neural network with stochastic output, it will result in a similar error to the one reported.