--- license: cc-by-sa-4.0 tags: - physics-simulation - n-body - scientific-machine-learning - visual-reasoning --- # N-Body Trajectories for Visual Reasoning Research ## Dataset Description This dataset contains a collection of simulated trajectories for a 3-body gravitational system. It was generated to train and evaluate "Visual Reasoning LoRA" (VR-LoRA) models as described in the paper: **"Visual Reasoning Transfer: Leveraging Pretrained Visual Models for Physical and Temporal Prediction"**. The core idea of the research is to encode these physical state vectors into "spatial field images" and train a vision model to predict the temporal evolution of the system. * **Research Project Repository:** [https://github.com/sandner-art/SC-Visual-Reasoning](https://github.com/sandner-art/SC-Visual-Reasoning) * **Trained Model (LoRA):** [huggingface.co/sandner/vr-lora-physics-sd15](https://huggingface.co/sandner/vr-lora-physics-sd15) ### How to Use this Dataset The dataset is provided as compressed NumPy `.npz` files. It can be loaded directly with NumPy. ```python import numpy as np from huggingface_hub import hf_hub_download # Download the training data file_path = hf_hub_download( repo_id="sandner/n-body-trajectories-for-vrlora", # Replace with your repo name filename="nbody_3_train_10000.npz", repo_type="dataset" ) # Load the trajectories data = np.load(file_path) trajectories = data['trajectories'] # The shape is (num_samples, num_timesteps, num_particles, state_dim) # e.g., (10000, 50, 3, 4) print(trajectories.shape) # Each state is a vector of [x, y, vx, vy] first_trajectory_first_step = trajectories print(first_trajectory_first_step) ``` ### Dataset Structure The repository contains two primary files: * `nbody_3_train_10000.npz`: The main training set with 10,000 trajectories. * `nbody_3_test_500.npz`: A smaller test set with 500 trajectories for evaluation. Each trajectory consists of 50 timesteps for a 3-particle system. Each particle's state at each timestep is represented by a 4-dimensional vector: `[position_x, position_y, velocity_x, velocity_y]`. ### Dataset Creation The data was generated using a custom Python script (`generate_dataset.py` in the main GitHub repo) that utilizes `scipy.integrate.solve_ivp` with a Runge-Kutta (RK45) method. Key simulation parameters: * **Gravitational Constant (G):** 1.0 * **Time Span:** 0.0 to 2.0 * **Softening Factor:** 1e-3 (to prevent numerical singularities) * **Initial Conditions:** Particle positions, velocities, and masses were sampled from uniform random distributions. ## Citing this Dataset If you use this dataset in your research, please cite our paper (BibTeX entry coming soon) and link back to this repository.