Reinforcement Learning
ml-agents
TensorBoard
ONNX
Pyramids
deep-reinforcement-learning
ML-Agents-Pyramids
Run this model with HF Jobs
Run Adilbai/Pyramids-RL-agent-ppo on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Adilbai/Pyramids-RL-agent-ppo. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Adilbai/Pyramids-RL-agent-ppo on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Adilbai/Pyramids-RL-agent-ppo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ml-agents
How to use Adilbai/Pyramids-RL-agent-ppo with ml-agents:
mlagents-load-from-hf --repo-id="Adilbai/Pyramids-RL-agent-ppo" --local-dir="./downloads"
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files5 unmodified lines678910111213141516171819202122232425262728293031323334355 unmodified lines- reinforcement-learning- ML-Agents-Pyramids---# **ppo** Agent playing **Pyramids**This is a trained model of a **ppo** agent playing **Pyramids**using the [Unity ML-Agents Library](https://github.com/Unity-Technologies/ml-agents).## Usage (with ML-Agents)The Documentation: https://unity-technologies.github.io/ml-agents/ML-Agents-Toolkit-Documentation/We wrote a complete tutorial to learn to train your first agent using ML-Agents and publish it to the Hub:- A *short tutorial* where you teach Huggy the Dog πΆ to fetch the stick and then play with him directly in yourbrowser: https://huggingface.co/learn/deep-rl-course/unitbonus1/introduction- A *longer tutorial* to understand how works ML-Agents:https://huggingface.co/learn/deep-rl-course/unit5/introduction### Resume the training```bashmlagents-learn <your_configuration_file_path.yaml> --run-id=<run_id> --resume```### Watch your Agent playYou can watch your agent **playing directly in your browser**1. If the environment is part of ML-Agents official environments, go to https://huggingface.co/unity2. Step 1: Find your model_id: Adilbai/Pyramids-RL-agent-ppo3. Step 2: Select your *.nn /*.onnx file4. Click on Watch the agent play π5 unmodified lines67891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492505 unmodified lines- reinforcement-learning- ML-Agents-Pyramids---# PPO-Pyramids Unity ML-Agents Model## Model DescriptionThis model is a Proximal Policy Optimization (PPO) agent trained to navigate and solve the Pyramids environment from Unity ML-Agents. The Pyramids environment is a complex 3D navigation and puzzle-solving task where agents must learn to reach goals while avoiding obstacles and navigating through pyramid-like structures.## Model Details### Model Architecture- **Algorithm**: Proximal Policy Optimization (PPO)- **Framework**: Unity ML-Agents with PyTorch backend- **Policy Type**: Actor-Critic with shared feature extraction- **Network Architecture**:- Hidden Units: 512 per layer- Number of Layers: 2- Activation: ReLU (default)- Normalization: Disabled- Visual Encoding: Simple CNN for visual observations### Environment: PyramidsThe Pyramids environment is one of Unity ML-Agents' example environments featuring:- **Objective**: Navigate to randomly spawned goal locations- **Setting**: 3D pyramid-like structures with multiple levels and obstacles- **Complexity**: Multi-agent environment with navigation and spatial reasoning challenges- **Visual Component**: First-person or third-person visual observations## Training Configuration### PPO Hyperparameters```yamlbatch_size: 128buffer_size: 2048learning_rate: 0.0003beta: 0.01 # Entropy regularizationepsilon: 0.2 # PPO clipping parameterlambda: 0.95 # GAE parameternum_epoch: 3 # Training epochs per updatelearning_rate_schedule: linear```### Network Settings```yamlnormalize: false # Input normalizationhidden_units: 512 # Units per hidden layernum_layers: 2 # Number of hidden layersvis_encode_type: simple # Visual encoder type```### Reward Structure- **Extrinsic Rewards**:- Gamma: 0.99 (discount factor)- Strength: 1.0- Sparse rewards for reaching goals- Time penalties for efficiency- **Intrinsic Rewards (RND)**:- Random Network Distillation for exploration- Gamma: 0.99- Strength: 0.01- Separate network: 64 units, 3 layers- Learning rate: 0.0001### Training Process- **Max Steps**: 1,000,000 training steps- **Time Horizon**: 128 steps per trajectory- **Checkpoints**: Keep 5 best models- **Summary Frequency**: Every 30,000 steps- **Training Time**: Approximately 4-8 hours on modern GPU## Observation SpaceThe agent receives:- **Visual Observations**: RGB camera input (84x84x3 typically)- **Vector Observations**: Agent position, rotation, velocity- **Goal Information**: Relative goal position and distance- **Environmental Context**: Obstacle proximity, platform information## Action Space- **Action Type**: Continuous- **Action Dimensions**: 3-4 continuous values- Forward/backward movement- Left/right movement- Rotation (yaw)- Optional: Jump action## Performance Metrics### Expected Performance- **Goal Reaching Success Rate**: 80-95%- **Average Episode Length**: Optimal path finding- **Training Convergence**: Stable improvement over 1M steps- **Exploration Efficiency**: Balanced exploration vs exploitation### Key Metrics Tracked- **Cumulative Reward**: Total reward per episode- **Success Rate**: Percentage of episodes reaching goal- **Episode Length**: Steps to complete episode- **Policy Entropy**: Measure of action diversity- **Value Function Accuracy**: Critic network performance## Technical Implementation### PPO Algorithm Features- **Policy Clipping**: Prevents destructive policy updates (Ξ΅=0.2)- **Generalized Advantage Estimation**: GAE with Ξ»=0.95- **Entropy Regularization**: Encourages exploration (Ξ²=0.01)- **Value Function Learning**: Shared network with policy### Random Network Distillation (RND)- **Purpose**: Intrinsic motivation for exploration- **Implementation**: Separate predictor and target networks- **Benefit**: Encourages visiting novel states- **Balance**: Low strength (0.01) to avoid overwhelming extrinsic rewards### Unity ML-Agents Integration- **Training Interface**: Python mlagents-learn command- **Environment Communication**: Unity-Python API- **Parallel Training**: Multiple environment instances- **Real-time Monitoring**: TensorBoard integration## Files and Structure```βββ Pyramids.onnx # Trained policy networkβββ Pyramids/β βββ checkpoint-{step}.onnx # Training checkpointsβ βββ configuration.yaml # Training configurationβ βββ run_logs/ # Training metricsβββ results/β βββ training_summary.json # Training statisticsβ βββ tensorboard_logs/ # TensorBoard data```## Usage### Loading the Model```pythonfrom mlagents_envs import UnityEnvironmentfrom mlagents_envs.side_channel.engine_configuration_channel import EngineConfigurationChannel# Load environmentchannel = EngineConfigurationChannel()env = UnityEnvironment(file_name="Pyramids", side_channels=[channel])# Model is loaded automatically when using mlagents-learn```### Training Command```bashmlagents-learn config.yaml --env=Pyramids --run-id=pyramids_run_01```### Resume the training```bashmlagents-learn <your_configuration_file_path.yaml> --run-id=<run_id> --resume```### Inference```python# The trained model can be used directly in Unity builds# or through the ML-Agents Python API for evaluation```## Limitations and Considerations1. **Environment Specific**: Trained specifically for Pyramids environment layout2. **Visual Dependency**: Performance tied to visual observation quality3. **Exploration Balance**: RND parameters may need tuning for different scenarios4. **Computational Requirements**: Requires GPU for efficient training5. **Generalization**: May not transfer well to significantly different navigation tasks## Optimization SuggestionsFor improved performance, consider:- **Enable normalization**: `normalize: true`- **Increase network capacity**: `hidden_units: 768`- **Longer time horizon**: `time_horizon: 256`- **Higher batch size**: `batch_size: 256`- **More training steps**: `max_steps: 2000000`## Applications- **Game AI**: Intelligent NPC navigation in 3D games- **Robotics Research**: Transfer learning for robot navigation- **Pathfinding**: Advanced pathfinding algorithm development- **Educational**: Demonstration of RL in complex 3D environments## Ethical ConsiderationsThis model represents a benign navigation task with no ethical concerns:- **Content**: Abstract geometric environment- **Purpose**: Educational and research applications- **Safety**: No real-world safety implications## System Requirements### Training- **OS**: Windows 10+, macOS 10.14+, Ubuntu 18.04+- **GPU**: NVIDIA GPU with CUDA support (recommended)- **RAM**: 8GB minimum, 16GB recommended- **Storage**: 2GB for environment and model files### Dependencies```unity-ml-agents>=0.28.0torch>=1.8.0tensorboardnumpy```## CitationIf you use this model, please cite:```bibtex@misc{ppo-pyramids-2024,title={PPO-Pyramids: Navigation Agent for Unity ML-Agents},author={Adilbai},year={2024},publisher={Hugging Face Hub},url={https://huggingface.co/Adilbai/ppo-pyramids}}```## References- Schulman, J., et al. (2017). Proximal Policy Optimization Algorithms. arXiv:1707.06347- Burda, Y., et al. (2018). Exploration by Random Network Distillation. arXiv:1810.12894- Unity Technologies. ML-Agents Toolkit Documentation- Juliani, A., et al. (2018). Unity: A General Platform for Intelligent Agents. arXiv:1809.02627## Training Logs and MonitoringMonitor training progress through:- **TensorBoard**: Real-time training metrics- **Console Output**: Episode rewards and statistics- **Checkpoint Analysis**: Model performance over time- **Success Rate Tracking**: Goal completion percentage---*For optimal results, consider using the improved configuration with normalization enabled and increased network capacity. ποΈπ―*
README.md+234-19