Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Adjacency Lists for Nodes in RoA Computation #1

Open
ds257 opened this issue Sep 30, 2024 · 2 comments
Open

Missing Adjacency Lists for Nodes in RoA Computation #1

ds257 opened this issue Sep 30, 2024 · 2 comments

Comments

@ds257
Copy link

ds257 commented Sep 30, 2024

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:

  • dytop version: 0.1.10
  • MORALS framework
  • Python 3.12

Best regards,
Diya Saraf

@aravindsiv
Copy link
Collaborator

Hi Diya,

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

@Ewerton-Vieira
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants