.. _ref-ray-examples: Ray 示例 ============ .. raw:: html
.. grid:: 1 2 2 2 :gutter: 1 :class-container: gallery-container container pb-3 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item llm gen-ai :link: https://www.anyscale.com/blog/ray-common-production-challenges-for-generative-ai-infrastructure Ray 如何解决生成式 AI 基础设施的常见生产挑战 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item training llm nlp gen-ai :link: https://www.anyscale.com/blog/training-175b-parameter-language-models-at-1000-gpu-scale-with-alpa-and-ray 使用 Alpa 和 Ray 在 1000 GPU 规模上训练 175B 参数语言模型 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item gen-ai cv training :link: https://www.anyscale.com/blog/faster-stable-diffusion-fine-tuning-with-ray-air 使用 Ray Train 进行更快稳定的扩散微调 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item training serving huggingface llm gen-ai :link: https://www.anyscale.com/blog/how-to-fine-tune-and-serve-llms How to fine tune and serve LLMs simply, quickly and cost effectively using Ray + DeepSpeed + HuggingFace .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item llm gen-ai :link: https://www.businessinsider.com/openai-chatgpt-trained-on-anyscale-ray-generative-lifelike-ai-models-2022-12 OpenAI 如何使用 Ray 训练 ChatGPT 等工具 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item llm gen-ai huggingface training nlp :link: /train/examples/deepspeed/gptj_deepspeed_fine_tuning :link-type: doc GPT-J-6B Fine-Tuning with Ray Train and DeepSpeed .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item llm gen-ai :link: https://github.com/ray-project/aviary/ Aviary 工具集为 LLM 提供实时流量服务 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item pytorch training :link: /train/examples/pytorch/convert_existing_pytorch_code_to_ray_train :link-type: doc 通过现有的 PyTorch 代码库开始使用 Ray Train .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training :link: /train/examples/lightgbm/lightgbm_example :link-type: doc LightGBM 分布式训练 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item training :link: /train/examples/xgboost/xgboost_example :link-type: doc XGBoost 分布式训练 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item llm nlp gen-ai inference :link: /data/examples/gptj_batch_prediction :link-type: doc 如何利用 Ray Data 对 Hugging Face Transformers GPT-J 模型进行批量预测 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving llm gen-ai :link: /ray-air/examples/gptj_serving :link-type: doc 如何利用 Ray Serve 对 Hugging Face Transformers GPT-J 模型进行在线服务 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv training gen-ai :link: /train/examples/pytorch/dreambooth_finetuning :link-type: doc 如何使用自己的图像对 DreamBooth 文本到图像模型进行微调 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training train llm nlp gen-ai :link: /train/examples/lightning/dolly_lightning_fsdp_finetuning :link-type: doc 使用 Ray Train、PyTorch Lightning 和 FSDP 对 dolly-v2-7b 进行微调 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch cv :link: /train/examples/pytorch/torch_detection :link-type: doc 使用 Ray Train 的 Torch 对象检测示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch :link: /data/examples/pytorch_resnet_batch_prediction :link-type: doc 使用 PyTorch ResNet152 进行图像分类批量推理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv gen-ai inference :link: /data/examples/stablediffusion_batch_prediction :link-type: doc 如何使用 Ray Data 对 Stable Diffusion 文本到图像模型进行批量预测 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv pytorch inference :link: /data/examples/batch_inference_object_detection :link-type: doc 使用 PyTorch FasterRCNN_ResNet50 进行对象检测批量推理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv pytorch inference :link: /data/examples/pytorch_resnet_batch_prediction :link-type: doc 使用 PyTorch ResNet18 进行图像分类批量推理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv inference huggingface :link: /data/examples/huggingface_vit_batch_prediction :link-type: doc 使用 Huggingface Vision Transformer 进行图像分类批量推理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch tensorflow serving :link: /serve/tutorials/serve-ml-models :link-type: doc 使用 Ray Serve 服务 ML 模型(Tensorflow、PyTorch、Scikit-Learn 等) .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving :link: /serve/tutorials/batch :link-type: doc 使用 Ray Serve 进行批处理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl serving :link: /serve/tutorials/rllib :link-type: doc 使用 Ray Serve 服务 RLlib 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving :link: /serve/tutorials/gradio-integration :link-type: doc 使用 Ray Serve 扩展 Gradio 应用 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving :link: /serve/tutorials/gradio-dag-visualization :link-type: doc 使用 Ray Serve 和 Gradio 可视化部署图 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving :link: /serve/tutorials/java :link-type: doc 使用 Ray Serve 的 Java 教程 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving cv :link: /serve/tutorials/stable-diffusion :link-type: doc 服务 Stable Diffusion 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving nlp :link: /serve/tutorials/text-classification :link-type: doc 服务 Distilbert 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item serving inference aws-neuron-core :link: /serve/tutorials/aws-neuron-core-inference :link-type: doc 在 AWS NeuronCore 上服务 Bert 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item cv serving :link: /serve/tutorials/object-detection :link-type: doc 服务对象检测模型 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item inference :link: https://www.anyscale.com/blog/offline-batch-inference-comparing-ray-apache-spark-and-sagemaker 离线批量推理:比较 Ray、Apache Spark 和 SageMaker .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://www.anyscale.com/blog/streaming-distributed-execution-across-cpus-and-gpus 通过 CPU 和 GPU 进行流式分布式执行 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item llm nlp data-processing inference gen-ai :link: https://www.anyscale.com/blog/turbocharge-langchain-now-guide-to-20x-faster-embedding 使用 Ray Data 并行化 LangChain 推理 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item data-processing inference :link: /data/batch_inference :link-type: doc 使用 Ray Data 进行批量预测 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item data-processing inference :link: /data/examples/nyc_taxi_basic_processing :link-type: doc 使用 Ray Data 对 NYC 出租车数据进行批量推理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item data-processing inference :link: /data/examples/ocr_example :link-type: doc 使用 Ray Data 进行批量 OCR 处理 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item training :link: https://www.anyscale.com/blog/training-one-million-machine-learning-models-in-record-time-with-ray 使用 Ray 在记录时间内训练一百万个机器学习模型 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item training :link: https://www.anyscale.com/blog/many-models-batch-training-at-scale-with-ray-core 使用 Ray Core 批量训练大规模模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training :link: /ray-core/examples/batch_training :link-type: doc 使用 Ray Core 进行批量训练 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item data-processing training :link: /data/examples/batch_training :link-type: doc 使用 Ray Data 进行批量训练 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tuning :link: /tune/tutorials/tune-run :link-type: doc 基础并行实验 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training tuning :link: /tune/examples/batch_tuning :link-type: doc 使用 Ray Tune 进行批量训练和调优 .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item :link: https://www.youtube.com/watch?v=3t26ucTy0Rs 在 Ray 上扩展 Instacart 履行 ML .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: tune-aim-ref :link-type: ref 使用 Aim 与 Ray Tune 进行实验管理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: tune-comet-ref :link-type: ref 使用 Comet 与 Ray Tune 进行实验管理 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tracking monitoring tuning :link: tune-wandb-ref :link-type: ref Tracking Your Experiment Process Weights & Biases .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tracking tuning :link: tune-mlflow-ref :link-type: ref 使用 MLflow 跟踪和 Tune 进行自动记录 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/ax_example :link-type: doc 如何使用 Ax 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/dragonfly_example :link-type: doc 如何使用 Dragonfly 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/hyperopt_example :link-type: doc 如何使用 HyperOpt 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/bayesopt_example :link-type: doc 如何使用 BayesOpt 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/flaml_example :link-type: doc 如何使用 BlendSearch 和 CFO 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/bohb_example :link-type: doc 如何使用 Tune 与 TuneBOHB .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/nevergrad_example :link-type: doc 如何使用 Nevergrad 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/optuna_example :link-type: doc 如何使用 Optuna 与 Ray Tune .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: /tune/examples/sigopt_example :link-type: doc 如何使用 SigOpt 与 Ray Tune .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item tuning serving :link: https://www.youtube.com/watch?v=UtH-CMpmxvI 使用 Ray Serve 在规模上实现 ML 生产 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item tuning serving :link: https://www.anyscale.com/blog/simplify-your-mlops-with-ray-and-ray-serve 使用 Ray & Ray Serve 简化您的 MLOps .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tuning serving :link: /serve/getting_started :link-type: doc Ray Serve 入门 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tuning serving :link: /serve/model_composition :link-type: doc 在 Serve 中进行模型组合 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tuning :link: /tune/getting-started :link-type: doc Ray Tune 入门 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item tuning :link: https://www.anyscale.com/blog/how-to-distribute-hyperparameter-tuning-using-ray-tune 如何使用 Ray Tune 分布式超参数调优 .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item :link: https://www.youtube.com/watch?v=KgYZtlbFYXE 简单的分布式超参数优化 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item tuning nlp huggingface :link: https://www.anyscale.com/blog/hyperparameter-search-hugging-face-transformers-ray-tune Hyperparameter Search with 🤗 Transformers .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tensorflow tuning tune :link: tune-mnist-keras :link-type: ref 如何使用 Tune 与 Keras 和 TF 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch tuning tune serve :link: tune-pytorch-cifar-ref :link-type: ref 如何使用 Tune 与 PyTorch 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch tuning tune serve :link: tune-pytorch-lightning-ref :link-type: ref 如何调整 PyTorch Lightning 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning serving tune serve :link: /tune/examples/tune-serve-integration-mnist :link-type: doc 使用 Ray Serve 进行模型选择和服务 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl tuning serving tune serve :link: tune-rllib-example :link-type: ref 使用 Ray Tune 和 Ray Serve 调整 RL 实验 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning tune serve :link: tune-xgboost-ref :link-type: ref 一个使用 Tune 调整 XGBoost 参数的指南 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning tune serve :link: tune-lightgbm-example :link-type: ref 一个使用 Tune 调整 LightGBM 参数的指南 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning tune serve :link: tune-horovod-example :link-type: ref 一个使用 Tune 调整 Horovod 参数的指南 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning huggingface tune serve nlp :link: tune-huggingface-example :link-type: ref 一个使用 Tune 调整 Huggingface Transformers 参数的指南 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tuning :link: https://www.anyscale.com/blog?tag=ray-tune 更多关于 Ray Tune 的用例 .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item pytorch :link: https://www.youtube.com/watch?v=e-A93QftCfc Ray Train, PyTorch, TorchX 和分布式深度学习 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item :link: /train/train :link-type: doc Ray Train 入门 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training huggingface nlp :link: /train/examples/transformers/huggingface_text_classification :link-type: doc 在 GLUE 基准上微调 🤗 Transformers 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch training train cv :link: torch_fashion_mnist_ex :link-type: ref PyTorch Fashion MNIST 训练示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tensorflow training train cv :link: tensorflow_mnist_example :link-type: ref TensorFlow MNIST 训练示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training train :link: horovod_example :link-type: ref 端到端 Horovod 训练示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch training cv :link: lightning_mnist_example :link-type: ref 端到端 PyTorch Lightning 训练示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item data-processing training nlp :link: lightning_advanced_example :link-type: ref 使用 Ray Data 对 PyTorch Lightning 文本分类器进行微调 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tensorflow tuning :link: tune_train_tf_example :link-type: ref 端到端示例,展示如何使用 Ray Tune 调整 TensorFlow 模型 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch tuning :link: tune_train_torch_example :link-type: ref 端到端示例,展示如何使用 Ray Tune 调整 PyTorch 模型 .. grid-item-card:: :bdg-info:`Course` :class-item: gallery-item rl :link: https://applied-rl-course.netlify.app/ 使用 RLlib 进行应用强化学习 .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item rl :link: https://medium.com/distributed-computing-with-ray/intro-to-rllib-example-environments-3a113f532c70 RLlib 的示例环境介绍 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl tuning :link: https://github.com/ray-project/ray/blob/master/rllib/tuned_examples RLlib 算法的超参调整集合 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/rl-experiments 针对 RLlib 的一系列合理优化的 Atari 和 MuJoCo 结果 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://medium.com/distributed-computing-with-ray/attention-nets-and-more-with-rllibs-trajectory-view-api-d326339a6e65 RLlib 的轨迹视图 API 及如何实现 GTrXL(注意力网络)架构 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://medium.com/distributed-computing-with-ray/reinforcement-learning-with-rllib-in-the-unity-game-engine-1a98080a7c0d 一个关于如何将 RLlib 与 Unity3D 游戏引擎连接以运行基于视觉和物理的 RL 实验的指南 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item pytorch tensorflow rl :link: https://medium.com/distributed-computing-with-ray/lessons-from-implementing-12-deep-rl-algorithms-in-tf-and-pytorch-1b412009297d 我们如何将 12 个 RLlib 算法从 TensorFlow 移植到 PyTorch,以及我们在此过程中学到的东西 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: http://bair.berkeley.edu/blog/2018/12/12/rllib 这篇博客是关于多智能体 RL 及其在 RLlib 中的设计的简要教程 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tensorflow rl :link: https://medium.com/riselab/functional-rl-with-keras-and-tensorflow-eager-7973f81d6345 探索了一种用于实现强化学习(RL)算法的函数式范式 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_env.py 定义和注册一个 gym 环境和模型供 RLlib 使用的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/tree/master/rllib/examples/unity3d_env_local.py 如何在本地运行的 Unity3D 编辑器上设置 RLlib 算法的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/env_rendering_and_recording.py 环境的渲染和记录 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/coin_game_env.py 基于 RLlib 的金币游戏示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/dmlab_watermaze.py 如何使用 DMLab 环境(Watermaze)的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/recommender_system_with_recsim_and_slateq.py RecSym 环境示例(用于推荐系统)使用 SlateQ 算法 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/sumo_env_local.py 演示如何在 RLlib 中使用 SUMO 仿真器的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/vizdoom_with_attention_net.py VizDoom 示例脚本使用 RLlib 的 auto-attention 包装器 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/env/tests/test_env_with_subprocess.py 如何确保 RLlib 退出时由 envs 生成的子进程被终止的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/attention_net.py Attention Net (GTrXL) 学习“重复我说的话”环境 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/lstm_auto_wrapping.py 展示如何在 RLlib 中使用自动 LSTM 包装器 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib pytorch tensorflow :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_rnn_model.py 使用自定义 Keras 或 PyTorch RNN 模型的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_model_loss_and_metrics.py 定义和注册具有监督损失的自定义模型的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/batch_norm_model.py 添加批量规范化层到自定义模型的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/eager_execution.py 如何利用 TensorFlow eager 简化自定义模型和策略的调试和设计的示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_fast_model.py 只有一个参数的快速 tf 和 torch 模型示例 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_model_api.py 展示了如何在 RLlib 中定义自定义 Model API,以便它可以在某些算法中使用。 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/trajectory_view_api.py 一个示例,展示了模型如何使用轨迹视图 API 来指定自己的输入。 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/mobilenet_v2_with_lstm.py Implementations of `MobileNetV2` and `torch.hub (mobilenet_v2)`-wrapping example models. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/models/neural_computer.py Example of DeepMind's Differentiable Neural Computer for partially-observable environments. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib training :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_train_fn.py Example of how to use Tune's support for custom training functions to implement custom training workflows. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/curriculum_learning.py Example of how to advance the environment through different phases (tasks) over time. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_logger.py How to setup a custom Logger object in RLlib. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib tensorflow :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_metrics_and_callbacks.py Example of how to output custom training metrics to TensorBoard. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib tensorflow :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_tf_policy.py How to setup a custom TFPolicy. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib pytorch :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_torch_policy.py How to setup a custom TorchPolicy. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/rollout_worker_custom_workflow.py Example of how to use RLlib's lower-level building blocks to implement a fully customized training workflow. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/two_trainer_workflow.py Example of how to use the exec. plan of an Algorithm to trin two different policies in parallel (also using multi-agent API). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_experiment.py How to run a custom Ray Tune experiment with RLlib with custom training- and evaluation phases. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_eval.py Example of how to write a custom evaluation function that is called instead of the default behavior, which is running with the evaluation worker set through n episodes. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/parallel_evaluation_and_training.py Example showing how the evaluation workers and the "normal" rollout workers can run (to some extend) in parallel to speed up training. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/tree/master/rllib/examples/offline_rl.py Example showing how to run an offline RL training job using a historic-data json file. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: serve-rllib-tutorial :link-type: ref Example of using Ray Serve to serve RLlib models with HTTP and JSON interface .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/tree/master/rllib/examples/inference_and_serving/serve_and_rllib.py This script offers a simple workflow for 1) training a policy with RLlib first, 2) creating a new policy 3) restoring its weights from the trained one and serving the new policy via Ray Serve. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/tree/master/rllib/examples/serving/unity3d_server.py Example of how to setup n distributed Unity3D (compiled) games in the cloud that function as data collecting clients against a central RLlib Policy server learning how to play the game. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/tree/master/rllib/examples/serving/cartpole_server.py Example of online serving of predictions for a simple CartPole policy. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/blob/master/rllib/examples/saving_experiences.py Example of how to externally generate experience batches in RLlib-compatible format. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib serving :link: https://github.com/ray-project/ray/blob/master/rllib/examples/checkpoint_by_custom_criteria.py Example of how to find a checkpoint after a `Tuner.fit()` via some custom defined criteria. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_independent_learning.py Setup RLlib to run any algorithm in (independent) multi-agent mode against a multi-agent environment. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_parameter_sharing.py Setup RLlib to run any algorithm in (shared-parameter) multi-agent mode against a multi-agent environment. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/rock_paper_scissors_multiagent.py Example of different heuristic and learned policies competing against each other in rock-paper-scissors. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/two_step_game.py Example of the two-step game from the QMIX paper. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/Farama-Foundation/PettingZoo/blob/master/tutorials/Ray/rllib_pistonball.py Example on how to use RLlib to learn in PettingZoo multi-agent environments. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/centralized_critic.py Example of customizing PPO to leverage a centralized value function. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/centralized_critic_2.py A simpler method of implementing a centralized critic by augmentating agent observations with global information. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_custom_policy.py Example of running a custom hand-coded policy alongside trainable policies. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_cartpole.py Example of how to define weight-sharing layers between two different policies. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent_two_trainers.py Example of alternating training between DQN and PPO. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/hierarchical_training.py Example of hierarchical training using the multi-agent API. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/iterated_prisoners_dilemma_env.py Example of an iterated prisoner's dilemma environment solved by RLlib. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/partial_gpus.py Example of how to setup fractional GPUs for learning (driver) and environment rollouts (remote workers). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/nested_action_spaces.py Learning in arbitrarily nested action spaces. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/parametric_actions_cartpole.py Example of how to handle variable-length or parametric action spaces .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_observation_filters.py How to filter raw observations coming from the environment for further processing by the Agent's model(s). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/complex_struct_space.py How to use RLlib's `Repeated` space to handle variable length observations. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ray-project/ray/blob/master/rllib/examples/autoregressive_action_dist.py Learning with auto-regressive action dependencies (e.g. 2 action components; distribution for 2nd component depends on the 1st component's actually sampled value). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://sites.google.com/view/arena-unity/home A General Evaluation Platform and Building Toolkit for Single/Multi-Agent Intelligence with RLlib-generated baselines. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/layssi/Carla_Ray_Rlib Example of training autonomous vehicles with RLlib and CARLA simulator. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://arxiv.org/pdf/2008.02616.pdf Using Graph Neural Networks and RLlib to train multiple cooperative and adversarial agents to solve the "cover the area"-problem, thereby learning how to best communicate (or - in the adversarial case - how to disturb communication). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://flatland.aicrowd.com/intro.html A dense traffic simulating environment with RLlib-generated baselines. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/google-research/football/blob/master/gfootball/examples/run_multiagent_rllib.py Example of setting up a multi-agent version of GFootball with RLlib. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/NeuralMMO/environment A multiagent AI research environment inspired by Massively Multiplayer Online (MMO) role playing games .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/neurocuts/neurocuts Example of building packet classification trees using RLlib / multi-agent in a bandit-like setting. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/ucb-bar/NeuroVectorizer Example of learning optimal LLVM vectorization compiler pragmas for loops in C and C++ codes using RLlib. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/eugenevinitsky/sequential_social_dilemma_games Example of using the multi-agent API to model several social dilemma games. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/lcipolina/Ray_tutorials/blob/main/RLLIB_Ray2_0.ipynb Create a custom environment and train a single agent RL using Ray 2.0 with Tune and Air. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://github.com/oxwhirl/smac Example of training in StarCraft2 maps with RLlib / multi-agent. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item rl rllib :link: https://berkeleyflow.readthedocs.io/en/latest/flow_setup.html Example of optimizing mixed-autonomy traffic simulations with RLlib / multi-agent. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tensorflow rl :link: https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_model.py Working with custom Keras models in RLlib .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item rl training :link: /rllib/rllib-training :link-type: doc Getting Started with RLlib .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item rl :link: https://www.anyscale.com/events/2022/03/29/deep-reinforcement-learning-at-riot-games Deep reinforcement learning at Riot Games .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://shopify.engineering/merlin-shopify-machine-learning-platform The Magic of Merlin - Shopify's New ML Platform .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item training :link: https://drive.google.com/file/d/1BS5lfXfuG5bnI8UM6FdUrR7CiSuWqdLn/view Large Scale Deep Learning Training and Tuning with Ray .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://www.instacart.com/company/how-its-made/griffin-how-instacarts-ml-platform-tripled-ml-applications-in-a-year/ Griffin: How Instacart’s ML Platform Tripled in a year .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item :link: https://www.youtube.com/watch?v=B5v9B5VSI7Q Predibase - A low-code deep learning platform built for scale .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://cloud.google.com/blog/products/ai-machine-learning/build-a-ml-platform-with-kubeflow-and-ray-on-gke Building a ML Platform with Kubeflow and Ray on GKE .. grid-item-card:: :bdg-warning:`Video` :class-item: gallery-item :link: https://www.youtube.com/watch?v=_L0lsShbKaY Ray Summit Panel - ML Platform on Ray .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item ts :link: /ray-core/examples/automl_for_time_series :link-type: doc AutoML for Time Series with Ray .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://www.anyscale.com/blog/building-highly-available-and-scalable-online-applications-on-ray-at-ant Highly Available and Scalable Online Applications on Ray at Ant Group .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://www.anyscale.com/blog/ray-forward-2022 Ray Forward 2022 Conference: Hyper-scale Ray Application Use Cases .. grid-item-card:: :bdg-primary:`Blog` :class-item: gallery-item :link: https://www.anyscale.com/blog/ray-breaks-the-usd1-tb-barrier-as-the-worlds-most-cost-efficient-sorting A new world record on the CloudSort benchmark using Ray .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item :link: /ray-core/examples/web-crawler :link-type: doc Speed up your web crawler by parallelizing it with Ray .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item huggingface cv data inference :link: /data/examples/huggingface_vit_batch_prediction :link-type: doc Image Classification Batch Inference with Huggingface Vision Transformer .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item pytorch cv data inference :link: /data/examples/pytorch_resnet_batch_prediction :link-type: doc Image Classification Batch Inference with PyTorch ResNet152 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item pytorch cv data inference :link: /data/examples/batch_inference_object_detection :link-type: doc Object Detection Batch Inference with PyTorch FasterRCNN_ResNet50 .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item data data-processing :link: /data/examples/nyc_taxi_basic_processing :link-type: doc Processing the NYC taxi dataset .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item data data-processing training :link: /data/examples/batch_training :link-type: doc Batch Training with Ray Data .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item data data-processing cv :link: /data/examples/ocr_example :link-type: doc Scaling OCR with Ray Data .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item data data-processing :link: /data/examples/random-access :link-type: doc Random Data Access (Experimental) .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item data data-processing :link: /data/examples/custom-datasource :link-type: doc Implementing a Custom Datasource .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core inference :link: /ray-core/examples/batch_prediction :link-type: doc Build Batch Prediction Using Ray .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core serve :link: /ray-core/examples/plot_parameter_server :link-type: doc Build a Simple Parameter Server Using Ray .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core :link: /ray-core/examples/plot_hyperparameter :link-type: doc Simple Parallel Model Selection .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core training :link: /ray-core/examples/plot_example-lm :link-type: doc Fault-Tolerant Fairseq Training .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core rl :link: /ray-core/examples/plot_pong_example :link-type: doc Learning to Play Pong .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core rl :link: /ray-core/examples/plot_example-a3c :link-type: doc Asynchronous Advantage Actor Critic (A3C) .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core :link: /ray-core/examples/gentle_walkthrough :link-type: doc A Gentle Introduction to Ray Core by Example .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core :link: /ray-core/examples/highly_parallel :link-type: doc Using Ray for Highly Parallelizable Tasks .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core :link: /ray-core/examples/map_reduce :link-type: doc Running a Simple MapReduce Example with Ray Core .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item core pytorch :link: train_benchmark :link-type: ref Benchmark example for the PyTorch data transfer auto pipeline .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tune :link: /tune/examples/tune-sklearn :link-type: doc How To Use Tune's Scikit-Learn Adapters? .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune :link: /tune/examples/includes/tune_basic_example :link-type: doc Simple example for doing a basic random and grid search. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune :link: /tune/examples/includes/async_hyperband_example :link-type: doc Example of using a simple tuning function with AsyncHyperBandScheduler. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune :link: /tune/examples/includes/hyperband_function_example :link-type: doc Example of using a Trainable function with HyperBandScheduler. Also uses the AsyncHyperBandScheduler. .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tune :link: /tune/examples/pbt_visualization/pbt_visualization :link-type: doc Configuring and running (synchronous) PBT and understanding the underlying algorithm behavior with a simple example. .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item tune :link: /tune/examples/includes/pbt_function :link-type: doc Example of using the function API with a PopulationBasedTraining scheduler. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune :link: /tune/examples/includes/pb2_example :link-type: doc Example of using the Population-based Bandits (PB2) scheduler. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune :link: /tune/examples/includes/logging_example :link-type: doc Example of custom loggers and custom trial directory naming. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune notebook tensorflow :link: https://colab.research.google.com/github/ray-project/tutorial/blob/master/tune_exercises/exercise_1_basics.ipynb Tune 的基础使用 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune notebook pytorch :link: https://colab.research.google.com/github/ray-project/tutorial/blob/master/tune_exercises/exercise_2_optimize.ipynb Using Search algorithms and Trial Schedulers to optimize your model. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune notebook pytorch :link: https://colab.research.google.com/github/ray-project/tutorial/blob/master/tune_exercises/exercise_3_pbt.ipynb Using Population-Based Training (PBT). .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune notebook huggingface pytorch :link: https://colab.research.google.com/drive/1tQgAKgcKQzheoh503OzhS4N9NtfFgmjF?usp=sharing Fine-tuning Huggingface Transformers with PBT. .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item tune notebook comet :link: https://colab.research.google.com/drive/1dp3VwVoAH1acn_kG7RuT62mICnOqxU1z?usp=sharing Logging Tune Runs to Comet ML. .. grid-item-card:: :bdg-success:`Tutorial` :class-item: gallery-item serve :link: /serve/tutorials/streaming :link-type: doc Using Ray Serve to deploy a chatbot .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training llm gen-ai :link: /train/examples/lightning/vicuna_13b_lightning_deepspeed_finetune :link-type: doc Fine-tune vicuna-13b-v1.3 with DeepSpeed, PyTorch Lightning and Ray Train .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training llm pytorch nlp :link: deepspeed_example :link-type: ref 分布式 DeepSpeed ZeRO-3 及 TorchTrainer 训练 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item training llm pytorch huggingface nlp :link: deepspeed_example :link-type: ref 分布式 Hugging Face Accelelate 及 TorchTrainer 训练 .. grid-item-card:: :bdg-secondary:`Code example` :class-item: gallery-item inference huggingface cv :link: kuberay-batch-inference-example :link-type: ref RayJob 在 Kubernetes 构建的 Ray 上进行批量推理示例