hyperdrone 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyperdrone/__init__.py +28 -0
- hyperdrone/_native/cmake/hyperdrone_jit.cmake +43 -0
- hyperdrone/_native/common/bindings.h +39 -0
- hyperdrone/_native/common/cuda_staging.h +68 -0
- hyperdrone/_native/common/jit_host.h +69 -0
- hyperdrone/_native/dynamics/CMakeLists.txt +66 -0
- hyperdrone/_native/dynamics/host.cpp +191 -0
- hyperdrone/_native/dynamics/iface.h +81 -0
- hyperdrone/_native/dynamics/impl.cpp +659 -0
- hyperdrone/_native/render/CMakeLists.txt +96 -0
- hyperdrone/_native/render/host.cpp +276 -0
- hyperdrone/_native/render/iface.h +132 -0
- hyperdrone/_native/render/impl.cpp +620 -0
- hyperdrone/_native/render/scene_bindings.cpp +279 -0
- hyperdrone/_vendor/rl-tools/CMakeLists.txt +159 -0
- hyperdrone/_vendor/rl-tools/LICENSE +21 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/all.cmake +14 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-diff.cmake +103 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/git-hash.cmake +13 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier1-blas.cmake +43 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier2-json-hdf5-zlib.cmake +84 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier3-tensorboard.cmake +29 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier4-cuda.cmake +33 -0
- hyperdrone/_vendor/rl-tools/cmake/autodetect/tier5-cli11.cmake +26 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/assimp_fixup.cmake +16 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/googletest.cmake +17 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/metal.cmake +27 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/mujoco.cmake +32 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/optix.cmake +17 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/raytracing_generic.cmake +4 -0
- hyperdrone/_vendor/rl-tools/cmake/optional/vulkan.cmake +6 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/embed_text.cmake +7 -0
- hyperdrone/_vendor/rl-tools/cmake/scripts/generate-git-snapshot.cmake +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/matrix.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_arm.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu.h +314 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_accelerate.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_blas.h +67 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_mkl.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cpu_openblas.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_cuda.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_dummy.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_esp32.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_generic.h +946 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/operations_wasm32.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/matrix/persist_code.h +136 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_arm.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu.h +94 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_accelerate.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_blas.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_mkl.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cpu_openblas.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_cuda.h +703 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/operations_generic.h +1334 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/persist_code.h +130 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/containers/tensor/tensor.h +490 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/arm.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu.h +205 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_accelerate.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_blas.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_mkl.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_openblas.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cpu_tensorboard.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/cuda.h +411 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/devices.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/dummy.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/esp32.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/generic.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/devices/wasm32.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/model.h +218 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/operations_generic.h +771 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/persist.h +278 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter.h +100 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/policy_adapter_persist.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/dyn/tensor_operations_generic.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_backend.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/c_interface.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/l2f.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_dyn.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/applications/l2f/operations_generic.h +268 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_backend.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/debugging_pool/c_interface.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_backend.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/c_interface.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/executor.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/helper.h +109 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/inference/executor/operations_generic.h +219 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arduino.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_arm.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cpu_tensorboard.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_cuda.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_dummy.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/logging/operations_wasm32.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_arm.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cpu.h +139 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_cuda.h +382 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_dummy.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_esp32.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_generic.h +297 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/math/operations_wasm32.h +225 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/mode/mode.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/activation_functions.h +115 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/capability.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/capability/persist_code.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_cuda.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/operations_generic.h +184 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/avg_pool2d/persist.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/layer.h +300 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cpu_mkl.h +590 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_cuda.h +739 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/operations_generic.h +1185 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/conv2d/persist_code.h +170 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/layer.h +145 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/dsp.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_arm/opt.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_accelerate.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_blas.h +282 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_mkl.h +66 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cpu_openblas.h +65 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_cuda.h +519 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/dsp.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_esp32/opt.h +167 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/operations_generic.h +421 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_code.h +178 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dense/persist_common.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/layer.h +188 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_cuda.h +356 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/operations_generic.h +534 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/dynamic_conv2d/persist.h +32 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/layer.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/operations_generic.h +217 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/embedding/persist.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/layer.h +121 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/operations_generic.h +152 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/flatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_cuda.h +375 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/helper_operations_generic.h +158 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/layer.h +218 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/operations_generic.h +947 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist.h +75 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/gru/persist_code.h +199 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/layers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/layer.h +143 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_cuda.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/operations_generic.h +214 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/max_pool2d/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_mkl.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_cuda.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/layer.h +223 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_cuda.h +138 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/operations_generic.h +428 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/resnet_block/persist.h +70 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/layer.h +154 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_cuda.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/operations_generic.h +494 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/sample_and_squash/persist_code.h +173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/layer.h +116 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_cuda.h +156 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/operations_generic.h +291 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist.h +83 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/standardize/persist_code.h +163 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/layer.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/operations_generic.h +268 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/td3_sampling/persist_code.h +164 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/layer.h +122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_cuda.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/operations_generic.h +158 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/unflatten/persist_code.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/layer.h +132 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_cuda.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/layers/upsample2d/operations_generic.h +228 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/categorical_cross_entropy/operations_generic.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_cuda.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/mse/operations_generic.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/loss_functions/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/nn.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_blas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_mux.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cpu_openblas.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_cuda.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/operations_generic.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/adam.h +120 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_cuda.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/operations_generic.h +144 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/instance/persist_code.h +79 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_cuda.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/operations_generic.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/adam/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/instance/operations_generic.h +101 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/lamb.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/lamb/operations_generic.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/optimizers.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_cuda.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/operations_generic.h +134 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/instance/persist_code.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_cuda.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/operations_generic.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/optimizers/sgd/sgd.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_cuda.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/operations_generic.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/parameters.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist.h +34 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/parameters/persist_code.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn/persist_code.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/network.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_cuda.h +10 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_dummy.h +8 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/operations_generic.h +381 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp/persist_code.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/network.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/operations_generic.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/mlp_unconditional_stddev/persist_code.h +135 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/models.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/model.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/operations_generic.h +280 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/multi_agent_wrapper/persist_code.h +71 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cpu.h +0 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_cuda.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_dummy.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/operations_generic.h +6 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/model.h +276 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_cuda.h +165 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/operations_generic.h +571 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist.h +80 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/parallel/persist_code.h +196 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/persist_code.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/model.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/random_uniform/operations_generic.h +73 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/resnet/resnet.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/model.h +256 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/operations_generic.h +564 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist.h +99 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/nn_models/sequential/persist_code.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/bf16.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/categories.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/persist_code.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/numeric_types/policy.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_2.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm/group_3.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/arm.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_accelerate.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_1.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mkl.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_mux.h +148 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_openblas.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard/group_3.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cpu_tensorboard.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_1.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/cuda.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/dummy.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_1.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32/group_3.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/esp32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_1.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_2.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32/group_3.h +12 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/operations/wasm32.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/hdf5.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/hdf5/operations_cpu.h +419 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/io.h +55 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_cpu.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_generic.h +620 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/operations_posix.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/backends/tar/tar.h +74 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/persist/code.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_arm.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cpu.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_cuda.h +164 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_dummy.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_esp32.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic.h +133 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_generic_array.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/operations_wasm32.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/random/persist.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/README.md +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_cpu.h +768 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/generic/operations_generic.h +1173 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/context.h +177 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/device_source.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/metal/operations_cpu.h +1122 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device.h +212 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/device_impl.h +934 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/operations_cuda.h +1678 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/optix/overlay_accel.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/context.h +220 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/device_source.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/backends/vulkan/operations_cpu.h +1967 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_common.h +1986 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/operations_cpu_mux.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/renderer.h +376 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/procthor/operations_cpu.h +226 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/procthor/scene.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene/scene.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/scene.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/transforms_generic.h +159 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rendering/raytracing/types.h +39 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/algorithms.h +6 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/operations_generic.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/config.h +240 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_cuda.h +62 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/operations_generic.h +245 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/persist.h +102 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/loop/core/state.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_cuda.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic.h +334 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/operations_generic_extensions.h +244 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/persist.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/ppo/ppo.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_gru.h +84 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/approximators_mlp.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/config.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/operations_generic.h +193 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/loop/core/state.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_cuda.h +131 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/operations_generic.h +580 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/sac/sac.h +151 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_gru.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/approximators_mlp.h +54 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/config.h +107 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/operations_generic.h +172 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/loop/core/state.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_accelerate.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mkl.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cpu_mux.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_cuda.h +111 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/operations_generic.h +359 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/algorithms/td3/td3.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/components.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/off_policy_runner.h +225 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu.h +95 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_accelerate.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cpu_mkl.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_cuda.h +237 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic.h +498 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/off_policy_runner/operations_generic_per_env.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/on_policy_runner.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_accelerate.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cpu_mkl.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_cuda.h +195 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic.h +197 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_extensions.h +98 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/operations_generic_per_env.h +91 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/on_policy_runner/persist.h +61 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_accelerate.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_cpu_mkl.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/operations_generic.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_cpu.h +9 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/operations_generic.h +123 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/persist.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/replay_buffer/replay_buffer.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/operations_generic.h +76 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/persist.h +31 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/components/running_normalizer/running_normalizer.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/operations_generic.h +58 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/operations_generic.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/scale_observations/wrapper.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environment_wrappers/wrappers.h +29 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/acrobot.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_cpu.h +152 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/acrobot/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/car.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_cpu.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_generic.h +206 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/operations_json.h +59 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/track.h +23 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/car/ui.h +189 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/environments.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/environment.h +87 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_cpu.h +212 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/flag/operations_generic.h +215 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/metrics.h +266 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/multirotor.h +1083 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cpu.h +2119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_cuda.h +38 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/05_state_is_nan.h +126 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/10_sample_initial_parameters.h +228 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/20_initial_state.h +189 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/30_sample_initial_state.h +276 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/35_get_desired_state.h +63 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/40_observe.h +625 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/50_state_algebra.h +57 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/60_dynamics.h +134 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/70_post_integration.h +329 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic/80_abs_diff.h +290 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_generic.h +369 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_helper_generic.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/operations_multitask_generic_forward.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/default.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/arpl.h +112 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie.h +127 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/crazyflie_openmv.h +119 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/flightmare.h +111 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/fs.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/mrs.h +110 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft.h +117 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/soft_rigid.h +118 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_real.h +88 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/dynamics/x500_sim.h +114 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/init/default.h +56 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/registry.h +90 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/default.h +64 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/reward_functions.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/operations_generic.h +202 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/reward_functions/squared/squared.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/termination/default.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/lissajous.h +72 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/parameters/trajectories/trajectory.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/persist_code.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/quaternion_helper.h +94 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f/ui.h +180 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/multirotor_visual.h +135 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_cpu.h +244 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_cuda.h +180 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/l2f_visual/operations_generic.h +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/environment.h +69 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_cpu.h +46 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/memory/operations_generic.h +78 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/README.MD +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ant.h +77 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/model.h +415 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/operations_cpu.h +160 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/ant/ui.h +141 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/mujoco/mujoco.h +1 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/bottleneck.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_cpu.h +289 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/bottleneck/operations_generic.h +495 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/multi_agent/environments.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/observation.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_cpu.h +2 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/operations_generic.h +33 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_cpu.h +146 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/operations_generic.h +262 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/pendulum.h +197 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui.h +97 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/pendulum/ui_xeus.h +124 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_cpu.h +426 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/operations_generic.h +424 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/environments/reacher/reacher.h +137 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/loop.h +15 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/config.h +28 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/operations_cpu.h +233 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/checkpoint/state.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/config.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/operations_generic.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/curriculum/state.h +17 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/config.h +47 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/operations_generic.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/persist.h +40 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/evaluation/state.h +36 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/config.h +22 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/operations_cpu.h +44 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/extrack/state.h +26 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/config.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/operations_cpu.h +113 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/nn_analytics/state.h +24 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/config.h +43 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/operations_cpu.h +190 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/persist.h +30 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/save_trajectories/state.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/steps.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/config.h +27 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/operations_cpu.h +52 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/persist.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/loop/steps/timing/state.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/operations_generic.h +3 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/rl.h +5 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/evaluation.h +106 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_cpu.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/evaluation/operations_generic.h +275 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation.h +269 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl/utils/validation_analysis.h +85 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/rl_tools.h +37 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/client.h +50 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_boost.h +92 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_cpu.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/client/operations_websocket.h +208 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/ui_server/server.h +448 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/universe.h +4 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/declarations_cpu.h +13 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_arm.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cpu.h +21 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_cuda.h +25 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_dummy.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_esp32.h +20 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_generic.h +19 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/assert/operations_wasm32.h +18 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_cpu.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/env/operations_generic.h +14 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/extrack.h +129 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/extrack/operations_cpu.h +588 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/integrators.h +105 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/memcpy.h +16 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/operations_generic.h +48 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/tuple/tuple.h +149 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/typing.h +118 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/generic/vector_operations.h +174 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_cuda.h +53 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/polyak/operations_generic.h +93 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/string/operations_generic.h +201 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/utils/zlib/operations_cpu.h +45 -0
- hyperdrone/_vendor/rl-tools/include/rl_tools/version.h +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/CMakeLists.txt +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/CMakeLists.txt +9 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/CMakeLists.txt +17 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/generic/freestanding_check.cpp +113 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/CMakeLists.txt +31 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/device.metal +815 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/metal/metal_cpp_impl.cpp +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/CMakeLists.txt +51 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/device.cu +1 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/optix/overlay_accel.cu +275 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/CMakeLists.txt +37 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device.comp +865 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/backends/vulkan/device_spirv.cpp +34 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/CMakeLists.txt +205 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/README.md +281 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark.cpp +175 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/benchmark_dynamic.cpp +494 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix.cpp +1629 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.cu +523 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/benchmark/simulator_matrix_physics.h +37 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/CMakeLists.txt +164 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/antialiasing.cpp +213 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone.cpp +367 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/drone_device.cu +385 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/environment.h +85 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/environment/operations_cpu.h +270 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/example.cpp +276 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/fixed_pose.cpp +218 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/interactive.cpp +866 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/make_drone_glb.py +172 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/motion_blur.cpp +232 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace.cpp +1833 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/example/render_pose_trace_motion_blur.cpp +646 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/CMakeLists.txt +147 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/README.md +15 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/job.sbatch +28 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model.h +260 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_config.h +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_forward_cuda.h +397 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_operations.h +418 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_persist.h +45 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/model_student.h +70 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.cpp +221 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/scene.h +68 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.build-check/inference_ios.o +0 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.build-check/libinference_ios.a +0 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/.gitignore +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/CMakeLists.txt +4 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info.plist +24 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Info_ios.plist +36 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/CameraManager.swift +120 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/ContentView.swift +703 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/DatasetRecorder.swift +285 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/Sources/YawPredictorApp.swift +25 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/YawPredictor.entitlements +8 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build.sh +66 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/build_ios.sh +133 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/generate.sh +6 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/h5_to_tar.cpp +82 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.cpp +166 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/inference.h +26 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/project.yml +30 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/swift_app/test_tar_vs_hdf5.cpp +173 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_cuda.cu +699 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_dataset_overlay.cpp +475 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_distill_cuda.cu +995 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_eval.cu +456 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_real_world_eval.cpp +660 -0
- hyperdrone/_vendor/rl-tools/src/rendering/raytracing/yaw_prediction/yaw_prediction_viewer.cu +445 -0
- hyperdrone/cuda/__init__.py +78 -0
- hyperdrone/dynamics/__init__.py +22 -0
- hyperdrone/dynamics/_component.py +40 -0
- hyperdrone/dynamics/_config.py +47 -0
- hyperdrone/dynamics/_sim.py +201 -0
- hyperdrone/env/__init__.py +15 -0
- hyperdrone/env/_sampling.py +67 -0
- hyperdrone/env/_world.py +60 -0
- hyperdrone/examples/__init__.py +11 -0
- hyperdrone/examples/benchmark.py +236 -0
- hyperdrone/examples/benchmark_minimal.py +66 -0
- hyperdrone/examples/data.py +42 -0
- hyperdrone/examples/drone_flythrough.py +142 -0
- hyperdrone/examples/render_procthor.py +41 -0
- hyperdrone/jit/__init__.py +111 -0
- hyperdrone/jit/_build.py +94 -0
- hyperdrone/jit/_lock.py +23 -0
- hyperdrone/jit/_patches.py +95 -0
- hyperdrone/jit/_toolchain.py +13 -0
- hyperdrone/jit/_workspace.py +70 -0
- hyperdrone/render/__init__.py +48 -0
- hyperdrone/render/_component.py +35 -0
- hyperdrone/render/_config.py +90 -0
- hyperdrone/render/_renderer.py +306 -0
- hyperdrone/render/_scene.py +34 -0
- hyperdrone-0.1.0.dist-info/METADATA +15 -0
- hyperdrone-0.1.0.dist-info/RECORD +660 -0
- hyperdrone-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#include "../../../version.h"
|
|
2
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_LAYERS_RESNET_BLOCK_OPERATIONS_CUDA_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
3
|
+
#pragma once
|
|
4
|
+
#define RL_TOOLS_NN_LAYERS_RESNET_BLOCK_OPERATIONS_CUDA_H
|
|
5
|
+
#include "../../../devices/cuda.h"
|
|
6
|
+
#include "../../../nn/nn.h"
|
|
7
|
+
#include "../../../mode/mode.h"
|
|
8
|
+
#include "../conv2d/operations_generic.h"
|
|
9
|
+
#include "../conv2d/operations_cuda.h"
|
|
10
|
+
#include "layer.h"
|
|
11
|
+
#include <cudnn.h>
|
|
12
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
13
|
+
namespace rl_tools{
|
|
14
|
+
namespace nn::layers::resnet_block::cuda::kernels{
|
|
15
|
+
template<typename DEV_SPEC, typename T>
|
|
16
|
+
__global__
|
|
17
|
+
void add_relu(devices::CUDA<DEV_SPEC> device, T* output, const T* shortcut, unsigned int n){
|
|
18
|
+
unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
|
|
19
|
+
if(i < n){
|
|
20
|
+
T val = output[i] + shortcut[i];
|
|
21
|
+
output[i] = val > T(0) ? val : T(0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
template<typename DEV_SPEC, typename T>
|
|
25
|
+
__global__
|
|
26
|
+
void d_relu_and_add(devices::CUDA<DEV_SPEC> device, const T* output, const T* d_output, T* d_pre_relu, unsigned int n){
|
|
27
|
+
unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
|
|
28
|
+
if(i < n){
|
|
29
|
+
d_pre_relu[i] = output[i] > T(0) ? d_output[i] : T(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
template<typename DEV_SPEC, typename T>
|
|
33
|
+
__global__
|
|
34
|
+
void add_inplace(devices::CUDA<DEV_SPEC> device, T* dst, const T* src, unsigned int n){
|
|
35
|
+
unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
|
|
36
|
+
if(i < n){
|
|
37
|
+
dst[i] += src[i];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
template<typename DEV_SPEC, typename LAYER_SPEC, typename INPUT_SPEC, typename OUTPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
42
|
+
void evaluate(devices::CUDA<DEV_SPEC>& device, const nn::layers::resnet_block::LayerForward<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<OUTPUT_SPEC>& output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
43
|
+
static_assert(nn::layers::resnet_block::check_input_output<LAYER_SPEC, INPUT_SPEC, OUTPUT_SPEC>);
|
|
44
|
+
using DEVICE = devices::CUDA<DEV_SPEC>;
|
|
45
|
+
using T = typename OUTPUT_SPEC::T;
|
|
46
|
+
using TI = typename DEVICE::index_t;
|
|
47
|
+
constexpr TI N = LAYER_SPEC::INTERNAL_BATCH_SIZE, OH = LAYER_SPEC::OUTPUT_HEIGHT, OW = LAYER_SPEC::OUTPUT_WIDTH, OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
48
|
+
constexpr TI OUTPUT_SIZE = N * OH * OW * OC;
|
|
49
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::CONV1_SPEC>&>(layer.conv1), input, buffer.intermediate, buffer.conv1_buffer, rng, mode);
|
|
50
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::CONV2_SPEC>&>(layer.conv2), buffer.intermediate, output, buffer.conv2_buffer, rng, mode);
|
|
51
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE){
|
|
52
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::DOWNSAMPLE_SPEC>&>(layer.downsample.conv), input, buffer.shortcut, buffer.downsample_buffer, rng, mode);
|
|
53
|
+
}
|
|
54
|
+
constexpr TI BLOCKSIZE = 256;
|
|
55
|
+
constexpr TI N_BLOCKS = RL_TOOLS_DEVICES_CUDA_CEIL(OUTPUT_SIZE, BLOCKSIZE);
|
|
56
|
+
devices::cuda::TAG<DEVICE, true> tag_device{};
|
|
57
|
+
const T* shortcut_ptr = LAYER_SPEC::HAS_DOWNSAMPLE ? buffer.shortcut._data : input._data;
|
|
58
|
+
nn::layers::resnet_block::cuda::kernels::add_relu<<<N_BLOCKS, BLOCKSIZE, 0, device.stream>>>(tag_device, output._data, shortcut_ptr, OUTPUT_SIZE);
|
|
59
|
+
check_status(device);
|
|
60
|
+
}
|
|
61
|
+
template<typename DEV_SPEC, typename LAYER_SPEC, typename INPUT_SPEC, typename OUTPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
62
|
+
void forward(devices::CUDA<DEV_SPEC>& device, nn::layers::resnet_block::LayerBackward<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<OUTPUT_SPEC>& output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
63
|
+
static_assert(nn::layers::resnet_block::check_input_output<LAYER_SPEC, INPUT_SPEC, OUTPUT_SPEC>);
|
|
64
|
+
using DEVICE = devices::CUDA<DEV_SPEC>;
|
|
65
|
+
using T = typename OUTPUT_SPEC::T;
|
|
66
|
+
using TI = typename DEVICE::index_t;
|
|
67
|
+
constexpr TI N = LAYER_SPEC::INTERNAL_BATCH_SIZE, OH = LAYER_SPEC::OUTPUT_HEIGHT, OW = LAYER_SPEC::OUTPUT_WIDTH, OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
68
|
+
constexpr TI OUTPUT_SIZE = N * OH * OW * OC;
|
|
69
|
+
forward(device, layer.conv1, input, buffer.intermediate, buffer.conv1_buffer, rng, mode);
|
|
70
|
+
forward(device, layer.conv2, buffer.intermediate, output, buffer.conv2_buffer, rng, mode);
|
|
71
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE){
|
|
72
|
+
forward(device, layer.downsample.conv, input, buffer.shortcut, buffer.downsample_buffer, rng, mode);
|
|
73
|
+
}
|
|
74
|
+
constexpr TI BLOCKSIZE = 256;
|
|
75
|
+
constexpr TI N_BLOCKS = RL_TOOLS_DEVICES_CUDA_CEIL(OUTPUT_SIZE, BLOCKSIZE);
|
|
76
|
+
devices::cuda::TAG<DEVICE, true> tag_device{};
|
|
77
|
+
const T* shortcut_ptr = LAYER_SPEC::HAS_DOWNSAMPLE ? buffer.shortcut._data : input._data;
|
|
78
|
+
nn::layers::resnet_block::cuda::kernels::add_relu<<<N_BLOCKS, BLOCKSIZE, 0, device.stream>>>(tag_device, output._data, shortcut_ptr, OUTPUT_SIZE);
|
|
79
|
+
check_status(device);
|
|
80
|
+
}
|
|
81
|
+
template<typename DEV_SPEC, typename LAYER_SPEC, typename INPUT_SPEC, typename D_OUTPUT_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
82
|
+
void backward(devices::CUDA<DEV_SPEC>& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<D_OUTPUT_SPEC>& d_output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
83
|
+
using DEVICE = devices::CUDA<DEV_SPEC>;
|
|
84
|
+
using T = typename LAYER_SPEC::TYPE_POLICY::template GET<numeric_types::categories::Gradient>;
|
|
85
|
+
using TI = typename DEVICE::index_t;
|
|
86
|
+
constexpr TI N = LAYER_SPEC::INTERNAL_BATCH_SIZE, OH = LAYER_SPEC::OUTPUT_HEIGHT, OW = LAYER_SPEC::OUTPUT_WIDTH, OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
87
|
+
constexpr TI OUTPUT_SIZE = N * OH * OW * OC;
|
|
88
|
+
constexpr TI BLOCKSIZE = 256;
|
|
89
|
+
constexpr TI N_BLOCKS = RL_TOOLS_DEVICES_CUDA_CEIL(OUTPUT_SIZE, BLOCKSIZE);
|
|
90
|
+
devices::cuda::TAG<DEVICE, true> tag_device{};
|
|
91
|
+
nn::layers::resnet_block::cuda::kernels::d_relu_and_add<<<N_BLOCKS, BLOCKSIZE, 0, device.stream>>>(tag_device, layer.output._data, d_output._data, buffer.shortcut._data, OUTPUT_SIZE);
|
|
92
|
+
auto conv1_out = rl_tools::output(device, layer.conv1);
|
|
93
|
+
backward(device, layer.conv2, conv1_out, buffer.shortcut, buffer.conv2_buffer, mode);
|
|
94
|
+
auto d_conv1_out = buffer.intermediate;
|
|
95
|
+
backward_input(device, static_cast<const nn::layers::conv2d::LayerBackward<typename LAYER_SPEC::CONV2_SPEC>&>(layer.conv2), buffer.shortcut, d_conv1_out, buffer.conv2_buffer, mode);
|
|
96
|
+
backward(device, layer.conv1, input, d_conv1_out, buffer.conv1_buffer, mode);
|
|
97
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE){
|
|
98
|
+
backward(device, layer.downsample.conv, input, buffer.shortcut, buffer.downsample_buffer, mode);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
template<typename DEV_SPEC, typename LAYER_SPEC, typename INPUT_SPEC, typename D_OUTPUT_SPEC, typename D_INPUT_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
102
|
+
void backward_full(devices::CUDA<DEV_SPEC>& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<D_OUTPUT_SPEC>& d_output, Tensor<D_INPUT_SPEC>& d_input, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
103
|
+
using DEVICE = devices::CUDA<DEV_SPEC>;
|
|
104
|
+
using T = typename LAYER_SPEC::TYPE_POLICY::template GET<numeric_types::categories::Gradient>;
|
|
105
|
+
using TI = typename DEVICE::index_t;
|
|
106
|
+
constexpr TI N = LAYER_SPEC::INTERNAL_BATCH_SIZE;
|
|
107
|
+
constexpr TI OH = LAYER_SPEC::OUTPUT_HEIGHT, OW = LAYER_SPEC::OUTPUT_WIDTH, OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
108
|
+
constexpr TI IH = LAYER_SPEC::INPUT_HEIGHT, IW = LAYER_SPEC::INPUT_WIDTH, IC = LAYER_SPEC::INPUT_CHANNELS;
|
|
109
|
+
constexpr TI OUTPUT_SIZE = N * OH * OW * OC;
|
|
110
|
+
constexpr TI INPUT_SIZE = N * IH * IW * IC;
|
|
111
|
+
constexpr TI BLOCKSIZE = 256;
|
|
112
|
+
devices::cuda::TAG<DEVICE, true> tag_device{};
|
|
113
|
+
// d_pre_relu = d_output * relu'(output)
|
|
114
|
+
nn::layers::resnet_block::cuda::kernels::d_relu_and_add<<<RL_TOOLS_DEVICES_CUDA_CEIL(OUTPUT_SIZE, BLOCKSIZE), BLOCKSIZE, 0, device.stream>>>(tag_device, layer.output._data, d_output._data, buffer.shortcut._data, OUTPUT_SIZE);
|
|
115
|
+
// backward_full through conv2
|
|
116
|
+
auto conv1_out = rl_tools::output(device, layer.conv1);
|
|
117
|
+
auto& d_pre_relu = buffer.shortcut;
|
|
118
|
+
backward_full(device, layer.conv2, conv1_out, d_pre_relu, buffer.intermediate, buffer.conv2_buffer, mode);
|
|
119
|
+
// backward_full through conv1
|
|
120
|
+
backward_full(device, layer.conv1, input, buffer.intermediate, d_input, buffer.conv1_buffer, mode);
|
|
121
|
+
// shortcut path
|
|
122
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE){
|
|
123
|
+
backward_full(device, layer.downsample.conv, input, d_pre_relu, buffer.d_input_buffer, buffer.downsample_buffer, mode);
|
|
124
|
+
nn::layers::resnet_block::cuda::kernels::add_inplace<<<RL_TOOLS_DEVICES_CUDA_CEIL(INPUT_SIZE, BLOCKSIZE), BLOCKSIZE, 0, device.stream>>>(tag_device, d_input._data, buffer.d_input_buffer._data, INPUT_SIZE);
|
|
125
|
+
} else {
|
|
126
|
+
nn::layers::resnet_block::cuda::kernels::add_inplace<<<RL_TOOLS_DEVICES_CUDA_CEIL(INPUT_SIZE, BLOCKSIZE), BLOCKSIZE, 0, device.stream>>>(tag_device, d_input._data, d_pre_relu._data, INPUT_SIZE);
|
|
127
|
+
}
|
|
128
|
+
check_status(device);
|
|
129
|
+
}
|
|
130
|
+
template<typename DEV_SPEC, typename SPEC>
|
|
131
|
+
void zero_gradient(devices::CUDA<DEV_SPEC>& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer) {
|
|
132
|
+
zero_gradient(device, layer.conv1);
|
|
133
|
+
zero_gradient(device, layer.conv2);
|
|
134
|
+
zero_gradient(device, layer.downsample);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
138
|
+
#endif
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
#include "../../../version.h"
|
|
2
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_LAYERS_RESNET_BLOCK_OPERATIONS_GENERIC_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
3
|
+
#pragma once
|
|
4
|
+
#define RL_TOOLS_NN_LAYERS_RESNET_BLOCK_OPERATIONS_GENERIC_H
|
|
5
|
+
#include "../../../containers/tensor/tensor.h"
|
|
6
|
+
#include "../conv2d/operations_generic.h"
|
|
7
|
+
#include "layer.h"
|
|
8
|
+
#ifndef RL_TOOLS_FUNCTION_PLACEMENT
|
|
9
|
+
#define RL_TOOLS_FUNCTION_PLACEMENT
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
13
|
+
namespace rl_tools{
|
|
14
|
+
// ======================== DownsampleStorage malloc / free / copy / etc ========================
|
|
15
|
+
template<typename DEVICE, typename LAYER>
|
|
16
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&) {}
|
|
17
|
+
template<typename DEVICE, typename LAYER>
|
|
18
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&) {}
|
|
19
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_LAYER, typename TARGET_LAYER>
|
|
20
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE&, TARGET_DEVICE&, const nn::layers::resnet_block::DownsampleStorage<false, SOURCE_LAYER>&, nn::layers::resnet_block::DownsampleStorage<false, TARGET_LAYER>&) {}
|
|
21
|
+
template<typename DEVICE, typename LAYER>
|
|
22
|
+
RL_TOOLS_FUNCTION_PLACEMENT void zero_gradient(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&) {}
|
|
23
|
+
template<typename DEVICE, typename LAYER, typename OPTIMIZER>
|
|
24
|
+
RL_TOOLS_FUNCTION_PLACEMENT void update(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, OPTIMIZER&) {}
|
|
25
|
+
template<typename DEVICE, typename LAYER, typename OPTIMIZER>
|
|
26
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, OPTIMIZER&) {}
|
|
27
|
+
template<typename DEVICE, typename SOURCE_LAYER, typename TARGET_LAYER>
|
|
28
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename SOURCE_LAYER::TYPE_POLICY::DEFAULT abs_diff(DEVICE&, const nn::layers::resnet_block::DownsampleStorage<false, SOURCE_LAYER>&, const nn::layers::resnet_block::DownsampleStorage<false, TARGET_LAYER>&) { return 0; }
|
|
29
|
+
template<typename DEVICE, typename LAYER, typename MODE>
|
|
30
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE&, const nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, const Mode<MODE>&) { return false; }
|
|
31
|
+
template<typename DEVICE, typename LAYER>
|
|
32
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&) {}
|
|
33
|
+
template<typename DEVICE, typename LAYER, typename RNG>
|
|
34
|
+
RL_TOOLS_FUNCTION_PLACEMENT void init_weights(DEVICE&, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, RNG&) {}
|
|
35
|
+
|
|
36
|
+
template<typename DEVICE, typename LAYER>
|
|
37
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds) { malloc(device, ds.conv); }
|
|
38
|
+
template<typename DEVICE, typename LAYER>
|
|
39
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds) { free(device, ds.conv); }
|
|
40
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_LAYER, typename TARGET_LAYER>
|
|
41
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn::layers::resnet_block::DownsampleStorage<true, SOURCE_LAYER>& source, nn::layers::resnet_block::DownsampleStorage<true, TARGET_LAYER>& target) { copy(source_device, target_device, source.conv, target.conv); }
|
|
42
|
+
template<typename DEVICE, typename LAYER>
|
|
43
|
+
RL_TOOLS_FUNCTION_PLACEMENT void zero_gradient(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds) { zero_gradient(device, ds.conv); }
|
|
44
|
+
template<typename DEVICE, typename LAYER, typename OPTIMIZER>
|
|
45
|
+
RL_TOOLS_FUNCTION_PLACEMENT void update(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, OPTIMIZER& opt) { update(device, ds.conv, opt); }
|
|
46
|
+
template<typename DEVICE, typename LAYER, typename OPTIMIZER>
|
|
47
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, OPTIMIZER& opt) { _reset_optimizer_state(device, ds.conv, opt); }
|
|
48
|
+
template<typename DEVICE, typename SOURCE_LAYER, typename TARGET_LAYER>
|
|
49
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto abs_diff(DEVICE& device, const nn::layers::resnet_block::DownsampleStorage<true, SOURCE_LAYER>& a, const nn::layers::resnet_block::DownsampleStorage<true, TARGET_LAYER>& b) { return abs_diff(device, a.conv, b.conv); }
|
|
50
|
+
template<typename DEVICE, typename LAYER, typename MODE>
|
|
51
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, const nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, const Mode<MODE>& mode) { return is_nan(device, ds.conv, mode); }
|
|
52
|
+
template<typename DEVICE, typename LAYER>
|
|
53
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds) { reset_forward_state(device, ds.conv); }
|
|
54
|
+
template<typename DEVICE, typename LAYER, typename RNG>
|
|
55
|
+
RL_TOOLS_FUNCTION_PLACEMENT void init_weights(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, RNG& rng) { init_weights(device, ds.conv, rng); }
|
|
56
|
+
|
|
57
|
+
// ======================== Buffer malloc / free ========================
|
|
58
|
+
template<typename DEVICE, typename BUFFER_SPEC>
|
|
59
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer) {
|
|
60
|
+
malloc(device, buffer.intermediate);
|
|
61
|
+
malloc(device, buffer.shortcut);
|
|
62
|
+
malloc(device, buffer.d_input_buffer);
|
|
63
|
+
malloc(device, buffer.conv1_buffer);
|
|
64
|
+
malloc(device, buffer.conv2_buffer);
|
|
65
|
+
malloc(device, buffer.downsample_buffer);
|
|
66
|
+
}
|
|
67
|
+
template<typename DEVICE, typename BUFFER_SPEC>
|
|
68
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer) {
|
|
69
|
+
free(device, buffer.intermediate);
|
|
70
|
+
free(device, buffer.shortcut);
|
|
71
|
+
free(device, buffer.d_input_buffer);
|
|
72
|
+
free(device, buffer.conv1_buffer);
|
|
73
|
+
free(device, buffer.conv2_buffer);
|
|
74
|
+
free(device, buffer.downsample_buffer);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// ======================== Layer malloc / free ========================
|
|
78
|
+
template<typename DEVICE, typename SPEC>
|
|
79
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn::layers::resnet_block::LayerForward<SPEC>& layer) {
|
|
80
|
+
malloc(device, layer.conv1);
|
|
81
|
+
malloc(device, layer.conv2);
|
|
82
|
+
malloc(device, layer.downsample);
|
|
83
|
+
}
|
|
84
|
+
template<typename DEVICE, typename SPEC>
|
|
85
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn::layers::resnet_block::LayerForward<SPEC>& layer) {
|
|
86
|
+
free(device, layer.conv1);
|
|
87
|
+
free(device, layer.conv2);
|
|
88
|
+
free(device, layer.downsample);
|
|
89
|
+
}
|
|
90
|
+
template<typename DEVICE, typename SPEC>
|
|
91
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn::layers::resnet_block::LayerBackward<SPEC>& layer) {
|
|
92
|
+
malloc(device, (nn::layers::resnet_block::LayerForward<SPEC>&)layer);
|
|
93
|
+
}
|
|
94
|
+
template<typename DEVICE, typename SPEC>
|
|
95
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn::layers::resnet_block::LayerBackward<SPEC>& layer) {
|
|
96
|
+
free(device, (nn::layers::resnet_block::LayerForward<SPEC>&)layer);
|
|
97
|
+
}
|
|
98
|
+
template<typename DEVICE, typename SPEC>
|
|
99
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer) {
|
|
100
|
+
malloc(device, (nn::layers::resnet_block::LayerBackward<SPEC>&)layer);
|
|
101
|
+
malloc(device, layer.output);
|
|
102
|
+
}
|
|
103
|
+
template<typename DEVICE, typename SPEC>
|
|
104
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer) {
|
|
105
|
+
free(device, (nn::layers::resnet_block::LayerBackward<SPEC>&)layer);
|
|
106
|
+
free(device, layer.output);
|
|
107
|
+
}
|
|
108
|
+
template<typename DEVICE>
|
|
109
|
+
RL_TOOLS_FUNCTION_PLACEMENT void malloc(DEVICE&, nn::layers::resnet_block::State&) {}
|
|
110
|
+
template<typename DEVICE>
|
|
111
|
+
RL_TOOLS_FUNCTION_PLACEMENT void free(DEVICE&, nn::layers::resnet_block::State&) {}
|
|
112
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE>
|
|
113
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE&, TARGET_DEVICE&, nn::layers::resnet_block::State&, nn::layers::resnet_block::State&) {}
|
|
114
|
+
template<typename SPEC, typename DEVICE, typename RNG, typename MODE>
|
|
115
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset(DEVICE&, const nn::layers::resnet_block::LayerForward<SPEC>&, nn::layers::resnet_block::State&, RNG&, Mode<MODE>) {}
|
|
116
|
+
|
|
117
|
+
// ======================== init_weights ========================
|
|
118
|
+
template<typename DEVICE, typename SPEC, typename RNG>
|
|
119
|
+
RL_TOOLS_FUNCTION_PLACEMENT void init_weights(DEVICE& device, nn::layers::resnet_block::LayerForward<SPEC>& layer, RNG& rng) {
|
|
120
|
+
init_weights(device, layer.conv1, rng);
|
|
121
|
+
init_weights(device, layer.conv2, rng);
|
|
122
|
+
init_weights(device, layer.downsample, rng);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ======================== evaluate ========================
|
|
126
|
+
#ifndef RL_TOOLS_NN_DISABLE_GENERIC_FORWARD_BACKWARD
|
|
127
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename OUTPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
128
|
+
RL_TOOLS_FUNCTION_PLACEMENT void evaluate(DEVICE& device, const nn::layers::resnet_block::LayerForward<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<OUTPUT_SPEC>& output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
129
|
+
static_assert(nn::layers::resnet_block::check_input_output<LAYER_SPEC, INPUT_SPEC, OUTPUT_SPEC>);
|
|
130
|
+
using TI = typename DEVICE::index_t;
|
|
131
|
+
using T = typename OUTPUT_SPEC::T;
|
|
132
|
+
constexpr TI BATCH = LAYER_SPEC::INTERNAL_BATCH_SIZE;
|
|
133
|
+
constexpr TI OH = LAYER_SPEC::OUTPUT_HEIGHT;
|
|
134
|
+
constexpr TI OW = LAYER_SPEC::OUTPUT_WIDTH;
|
|
135
|
+
constexpr TI OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
136
|
+
|
|
137
|
+
using INTERNAL_INPUT_SHAPE = tensor::Shape<TI, BATCH, LAYER_SPEC::INPUT_HEIGHT, LAYER_SPEC::INPUT_WIDTH, LAYER_SPEC::INPUT_CHANNELS>;
|
|
138
|
+
using INTERNAL_OUTPUT_SHAPE = tensor::Shape<TI, BATCH, OH, OW, OC>;
|
|
139
|
+
auto input_4d = view_memory<INTERNAL_INPUT_SHAPE>(device, input);
|
|
140
|
+
auto output_4d = view_memory<INTERNAL_OUTPUT_SHAPE>(device, output);
|
|
141
|
+
|
|
142
|
+
// Conv1: input → intermediate
|
|
143
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::CONV1_SPEC>&>(layer.conv1), input, buffer.intermediate, buffer.conv1_buffer, rng, mode);
|
|
144
|
+
// Conv2: intermediate → output (temporary, before skip)
|
|
145
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::CONV2_SPEC>&>(layer.conv2), buffer.intermediate, output, buffer.conv2_buffer, rng, mode);
|
|
146
|
+
// Downsample shortcut if needed
|
|
147
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
148
|
+
evaluate(device, static_cast<const nn::layers::conv2d::LayerForward<typename LAYER_SPEC::DOWNSAMPLE_SPEC>&>(layer.downsample.conv), input, buffer.shortcut, buffer.downsample_buffer, rng, mode);
|
|
149
|
+
}
|
|
150
|
+
// output = ReLU(conv2_out + shortcut)
|
|
151
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
152
|
+
for(TI h = 0; h < OH; h++){
|
|
153
|
+
for(TI w = 0; w < OW; w++){
|
|
154
|
+
for(TI c = 0; c < OC; c++){
|
|
155
|
+
T conv2_val = get(device, output_4d, bi, h, w, c);
|
|
156
|
+
T shortcut_val;
|
|
157
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
158
|
+
shortcut_val = get(device, buffer.shortcut, bi, h, w, c);
|
|
159
|
+
} else {
|
|
160
|
+
shortcut_val = get(device, input_4d, bi, h, w, c);
|
|
161
|
+
}
|
|
162
|
+
set(device, output_4d, math::max(device.math, conv2_val + shortcut_val, (T)0), bi, h, w, c);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename OUTPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
170
|
+
RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn::layers::resnet_block::LayerBackward<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<OUTPUT_SPEC>& output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
171
|
+
static_assert(nn::layers::resnet_block::check_input_output<LAYER_SPEC, INPUT_SPEC, OUTPUT_SPEC>);
|
|
172
|
+
using TI = typename DEVICE::index_t;
|
|
173
|
+
using T = typename OUTPUT_SPEC::T;
|
|
174
|
+
constexpr TI BATCH = LAYER_SPEC::INTERNAL_BATCH_SIZE;
|
|
175
|
+
constexpr TI OH = LAYER_SPEC::OUTPUT_HEIGHT;
|
|
176
|
+
constexpr TI OW = LAYER_SPEC::OUTPUT_WIDTH;
|
|
177
|
+
constexpr TI OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
178
|
+
|
|
179
|
+
using INTERNAL_INPUT_SHAPE = tensor::Shape<TI, BATCH, LAYER_SPEC::INPUT_HEIGHT, LAYER_SPEC::INPUT_WIDTH, LAYER_SPEC::INPUT_CHANNELS>;
|
|
180
|
+
auto input_4d = view_memory<INTERNAL_INPUT_SHAPE>(device, input);
|
|
181
|
+
auto output_4d = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, output);
|
|
182
|
+
|
|
183
|
+
// Conv1: input → buffer.intermediate
|
|
184
|
+
forward(device, layer.conv1, input, buffer.intermediate, buffer.conv1_buffer, rng, mode);
|
|
185
|
+
// Conv2: buffer.intermediate → output (before skip addition)
|
|
186
|
+
forward(device, layer.conv2, buffer.intermediate, output, buffer.conv2_buffer, rng, mode);
|
|
187
|
+
// Downsample shortcut if needed
|
|
188
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
189
|
+
forward(device, layer.downsample.conv, input, buffer.shortcut, buffer.downsample_buffer, rng, mode);
|
|
190
|
+
}
|
|
191
|
+
// output = ReLU(conv2_out + shortcut)
|
|
192
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
193
|
+
for(TI h = 0; h < OH; h++){
|
|
194
|
+
for(TI w = 0; w < OW; w++){
|
|
195
|
+
for(TI c = 0; c < OC; c++){
|
|
196
|
+
T conv2_val = get(device, output_4d, bi, h, w, c);
|
|
197
|
+
T shortcut_val;
|
|
198
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
199
|
+
shortcut_val = get(device, buffer.shortcut, bi, h, w, c);
|
|
200
|
+
} else {
|
|
201
|
+
shortcut_val = get(device, input_4d, bi, h, w, c);
|
|
202
|
+
}
|
|
203
|
+
set(device, output_4d, math::max(device.math, conv2_val + shortcut_val, (T)0), bi, h, w, c);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
#endif
|
|
210
|
+
|
|
211
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
212
|
+
RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
213
|
+
forward(device, static_cast<nn::layers::resnet_block::LayerBackward<LAYER_SPEC>&>(layer), input, layer.output, buffer, rng, mode);
|
|
214
|
+
}
|
|
215
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename OUTPUT_SPEC, typename BUFFER_SPEC, typename RNG, typename MODE = mode::Default<>>
|
|
216
|
+
RL_TOOLS_FUNCTION_PLACEMENT void forward(DEVICE& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<OUTPUT_SPEC>& output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, RNG& rng, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
217
|
+
forward(device, layer, input, buffer, rng, mode);
|
|
218
|
+
copy(device, device, layer.output, output);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// ======================== backward ========================
|
|
222
|
+
// backward_input: compute d_input only (no gradient accumulation)
|
|
223
|
+
template<typename DEVICE, typename LAYER_SPEC, typename D_OUTPUT_SPEC, typename D_INPUT_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
224
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward_input(DEVICE& device, const nn::layers::resnet_block::LayerBackward<LAYER_SPEC>& layer, const Tensor<D_OUTPUT_SPEC>& d_output, Tensor<D_INPUT_SPEC>& d_input, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
225
|
+
// Not implemented standalone (use backward_full)
|
|
226
|
+
}
|
|
227
|
+
// backward: accumulate parameter gradients only (no d_input)
|
|
228
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename D_OUTPUT_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
229
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward(DEVICE& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<D_OUTPUT_SPEC>& d_output, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
230
|
+
using TI = typename DEVICE::index_t;
|
|
231
|
+
using T = typename LAYER_SPEC::TYPE_POLICY::template GET<numeric_types::categories::Gradient>;
|
|
232
|
+
constexpr TI BATCH = LAYER_SPEC::INTERNAL_BATCH_SIZE;
|
|
233
|
+
constexpr TI OH = LAYER_SPEC::OUTPUT_HEIGHT;
|
|
234
|
+
constexpr TI OW = LAYER_SPEC::OUTPUT_WIDTH;
|
|
235
|
+
constexpr TI OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
236
|
+
// Step 1: d_pre_relu = d_output * relu'(output)
|
|
237
|
+
auto output_view = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, layer.output);
|
|
238
|
+
auto d_output_4d = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, d_output);
|
|
239
|
+
auto d_pre_relu = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, buffer.shortcut);
|
|
240
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
241
|
+
for(TI h = 0; h < OH; h++){
|
|
242
|
+
for(TI w = 0; w < OW; w++){
|
|
243
|
+
for(TI c = 0; c < OC; c++){
|
|
244
|
+
T out_val = get(device, output_view, bi, h, w, c);
|
|
245
|
+
T d_val = get(device, d_output_4d, bi, h, w, c);
|
|
246
|
+
set(device, d_pre_relu, out_val > (T)0 ? d_val : (T)0, bi, h, w, c);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
// Step 2: backward through conv2 (accumulate gradients, get d_conv1_out)
|
|
252
|
+
auto conv1_out = rl_tools::output(device, layer.conv1);
|
|
253
|
+
backward(device, layer.conv2, conv1_out, d_pre_relu, buffer.conv2_buffer, mode);
|
|
254
|
+
// Step 3: backward through conv1 (accumulate gradients)
|
|
255
|
+
// Need d_conv1_out from conv2's backward_input
|
|
256
|
+
auto d_conv1_out = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, buffer.intermediate);
|
|
257
|
+
backward_input(device, static_cast<const nn::layers::conv2d::LayerBackward<typename LAYER_SPEC::CONV2_SPEC>&>(layer.conv2), d_pre_relu, d_conv1_out, buffer.conv2_buffer, mode);
|
|
258
|
+
backward(device, layer.conv1, input, d_conv1_out, buffer.conv1_buffer, mode);
|
|
259
|
+
// Step 4: backward through downsample (accumulate gradients)
|
|
260
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
261
|
+
backward(device, layer.downsample.conv, input, d_pre_relu, buffer.downsample_buffer, mode);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// backward_full: compute d_input AND accumulate parameter gradients
|
|
265
|
+
template<typename DEVICE, typename LAYER_SPEC, typename INPUT_SPEC, typename D_OUTPUT_SPEC, typename D_INPUT_SPEC, typename BUFFER_SPEC, typename MODE = mode::Default<>>
|
|
266
|
+
RL_TOOLS_FUNCTION_PLACEMENT void backward_full(DEVICE& device, nn::layers::resnet_block::LayerGradient<LAYER_SPEC>& layer, const Tensor<INPUT_SPEC>& input, Tensor<D_OUTPUT_SPEC>& d_output, Tensor<D_INPUT_SPEC>& d_input, nn::layers::resnet_block::Buffer<BUFFER_SPEC>& buffer, const Mode<MODE>& mode = Mode<mode::Default<>>{}){
|
|
267
|
+
using TI = typename DEVICE::index_t;
|
|
268
|
+
using T = typename LAYER_SPEC::TYPE_POLICY::template GET<numeric_types::categories::Gradient>;
|
|
269
|
+
constexpr TI BATCH = LAYER_SPEC::INTERNAL_BATCH_SIZE;
|
|
270
|
+
constexpr TI OH = LAYER_SPEC::OUTPUT_HEIGHT;
|
|
271
|
+
constexpr TI OW = LAYER_SPEC::OUTPUT_WIDTH;
|
|
272
|
+
constexpr TI OC = LAYER_SPEC::OUTPUT_CHANNELS;
|
|
273
|
+
constexpr TI IH = LAYER_SPEC::INPUT_HEIGHT;
|
|
274
|
+
constexpr TI IW = LAYER_SPEC::INPUT_WIDTH;
|
|
275
|
+
constexpr TI IC = LAYER_SPEC::INPUT_CHANNELS;
|
|
276
|
+
// Step 1: d_pre_relu = d_output * relu'(output)
|
|
277
|
+
auto output_view = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, layer.output);
|
|
278
|
+
auto d_output_4d = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, d_output);
|
|
279
|
+
auto d_pre_relu = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, buffer.shortcut);
|
|
280
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
281
|
+
for(TI h = 0; h < OH; h++){
|
|
282
|
+
for(TI w = 0; w < OW; w++){
|
|
283
|
+
for(TI c = 0; c < OC; c++){
|
|
284
|
+
T out_val = get(device, output_view, bi, h, w, c);
|
|
285
|
+
T d_val = get(device, d_output_4d, bi, h, w, c);
|
|
286
|
+
set(device, d_pre_relu, out_val > (T)0 ? d_val : (T)0, bi, h, w, c);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// Step 2: backward_full through conv2 (accumulate gradients + d_conv1_out)
|
|
292
|
+
auto conv1_out = rl_tools::output(device, layer.conv1);
|
|
293
|
+
auto d_conv1_out = view_memory<tensor::Shape<TI, BATCH, OH, OW, OC>>(device, buffer.intermediate);
|
|
294
|
+
backward_full(device, layer.conv2, conv1_out, d_pre_relu, d_conv1_out, buffer.conv2_buffer, mode);
|
|
295
|
+
// Step 3: backward_full through conv1 (accumulate gradients + d_input)
|
|
296
|
+
backward_full(device, layer.conv1, input, d_conv1_out, d_input, buffer.conv1_buffer, mode);
|
|
297
|
+
// Step 4: backward through shortcut path and add to d_input
|
|
298
|
+
if constexpr(LAYER_SPEC::HAS_DOWNSAMPLE) {
|
|
299
|
+
auto d_input_ds = view_memory<tensor::Shape<TI, BATCH, IH, IW, IC>>(device, buffer.d_input_buffer);
|
|
300
|
+
backward_full(device, layer.downsample.conv, input, d_pre_relu, d_input_ds, buffer.downsample_buffer, mode);
|
|
301
|
+
// d_input += d_input_ds
|
|
302
|
+
auto d_input_4d = view_memory<tensor::Shape<TI, BATCH, IH, IW, IC>>(device, d_input);
|
|
303
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
304
|
+
for(TI h = 0; h < IH; h++){
|
|
305
|
+
for(TI w = 0; w < IW; w++){
|
|
306
|
+
for(TI c = 0; c < IC; c++){
|
|
307
|
+
increment(device, d_input_4d, get(device, d_input_ds, bi, h, w, c), bi, h, w, c);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
} else {
|
|
313
|
+
// Identity shortcut: d_input += d_pre_relu
|
|
314
|
+
// d_pre_relu has shape (BATCH, OH, OW, OC) and d_input has shape (BATCH, IH, IW, IC)
|
|
315
|
+
// For identity shortcut, OH==IH, OW==IW, OC==IC
|
|
316
|
+
auto d_input_4d = view_memory<tensor::Shape<TI, BATCH, IH, IW, IC>>(device, d_input);
|
|
317
|
+
for(TI bi = 0; bi < BATCH; bi++){
|
|
318
|
+
for(TI h = 0; h < IH; h++){
|
|
319
|
+
for(TI w = 0; w < IW; w++){
|
|
320
|
+
for(TI c = 0; c < IC; c++){
|
|
321
|
+
increment(device, d_input_4d, get(device, d_pre_relu, bi, h, w, c), bi, h, w, c);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// ======================== zero_gradient / update / _reset_optimizer_state ========================
|
|
330
|
+
template<typename DEVICE, typename SPEC>
|
|
331
|
+
RL_TOOLS_FUNCTION_PLACEMENT void zero_gradient(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer) {
|
|
332
|
+
zero_gradient(device, layer.conv1);
|
|
333
|
+
zero_gradient(device, layer.conv2);
|
|
334
|
+
zero_gradient(device, layer.downsample);
|
|
335
|
+
}
|
|
336
|
+
template<typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
337
|
+
RL_TOOLS_FUNCTION_PLACEMENT void update(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer, OPTIMIZER& optimizer) {
|
|
338
|
+
update(device, layer.conv1, optimizer);
|
|
339
|
+
update(device, layer.conv2, optimizer);
|
|
340
|
+
update(device, layer.downsample, optimizer);
|
|
341
|
+
}
|
|
342
|
+
template<typename DEVICE, typename SPEC, typename OPTIMIZER>
|
|
343
|
+
RL_TOOLS_FUNCTION_PLACEMENT void _reset_optimizer_state(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer, OPTIMIZER& optimizer) {
|
|
344
|
+
_reset_optimizer_state(device, layer.conv1, optimizer);
|
|
345
|
+
_reset_optimizer_state(device, layer.conv2, optimizer);
|
|
346
|
+
_reset_optimizer_state(device, layer.downsample, optimizer);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// ======================== copy ========================
|
|
350
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
|
|
351
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn::layers::resnet_block::LayerForward<SOURCE_SPEC>& source, nn::layers::resnet_block::LayerForward<TARGET_SPEC>& target) {
|
|
352
|
+
static_assert(nn::layers::resnet_block::check_spec_memory<SOURCE_SPEC, TARGET_SPEC>);
|
|
353
|
+
copy(source_device, target_device, source.conv1, target.conv1);
|
|
354
|
+
copy(source_device, target_device, source.conv2, target.conv2);
|
|
355
|
+
copy(source_device, target_device, source.downsample, target.downsample);
|
|
356
|
+
}
|
|
357
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
|
|
358
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn::layers::resnet_block::LayerBackward<SOURCE_SPEC>& source, nn::layers::resnet_block::LayerBackward<TARGET_SPEC>& target) {
|
|
359
|
+
static_assert(nn::layers::resnet_block::check_spec_memory<SOURCE_SPEC, TARGET_SPEC>);
|
|
360
|
+
copy(source_device, target_device, static_cast<const nn::layers::resnet_block::LayerForward<SOURCE_SPEC>&>(source), static_cast<nn::layers::resnet_block::LayerForward<TARGET_SPEC>&>(target));
|
|
361
|
+
}
|
|
362
|
+
template<typename SOURCE_DEVICE, typename TARGET_DEVICE, typename SOURCE_SPEC, typename TARGET_SPEC>
|
|
363
|
+
RL_TOOLS_FUNCTION_PLACEMENT void copy(SOURCE_DEVICE& source_device, TARGET_DEVICE& target_device, const nn::layers::resnet_block::LayerGradient<SOURCE_SPEC>& source, nn::layers::resnet_block::LayerGradient<TARGET_SPEC>& target) {
|
|
364
|
+
static_assert(nn::layers::resnet_block::check_spec_memory<SOURCE_SPEC, TARGET_SPEC>);
|
|
365
|
+
copy(source_device, target_device, static_cast<const nn::layers::resnet_block::LayerBackward<SOURCE_SPEC>&>(source), static_cast<nn::layers::resnet_block::LayerBackward<TARGET_SPEC>&>(target));
|
|
366
|
+
copy(source_device, target_device, source.output, target.output);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// ======================== abs_diff ========================
|
|
370
|
+
template<typename DEVICE, typename S1, typename S2>
|
|
371
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename S1::TYPE_POLICY::DEFAULT abs_diff(DEVICE& device, const nn::layers::resnet_block::LayerForward<S1>& l1, const nn::layers::resnet_block::LayerForward<S2>& l2) {
|
|
372
|
+
using T = typename S1::TYPE_POLICY::DEFAULT;
|
|
373
|
+
T acc = 0;
|
|
374
|
+
acc += abs_diff(device, l1.conv1, l2.conv1);
|
|
375
|
+
acc += abs_diff(device, l1.conv2, l2.conv2);
|
|
376
|
+
acc += abs_diff(device, l1.downsample, l2.downsample);
|
|
377
|
+
return acc;
|
|
378
|
+
}
|
|
379
|
+
template<typename DEVICE, typename S1, typename S2>
|
|
380
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename S1::TYPE_POLICY::DEFAULT abs_diff(DEVICE& device, const nn::layers::resnet_block::LayerBackward<S1>& l1, const nn::layers::resnet_block::LayerBackward<S2>& l2) {
|
|
381
|
+
return abs_diff(device, static_cast<const nn::layers::resnet_block::LayerForward<S1>&>(l1), static_cast<const nn::layers::resnet_block::LayerForward<S2>&>(l2));
|
|
382
|
+
}
|
|
383
|
+
template<typename DEVICE, typename S1, typename S2>
|
|
384
|
+
RL_TOOLS_FUNCTION_PLACEMENT typename S1::TYPE_POLICY::DEFAULT abs_diff(DEVICE& device, const nn::layers::resnet_block::LayerGradient<S1>& l1, const nn::layers::resnet_block::LayerGradient<S2>& l2) {
|
|
385
|
+
auto acc = abs_diff(device, static_cast<const nn::layers::resnet_block::LayerBackward<S1>&>(l1), static_cast<const nn::layers::resnet_block::LayerBackward<S2>&>(l2));
|
|
386
|
+
acc += abs_diff(device, l1.output, l2.output);
|
|
387
|
+
return acc;
|
|
388
|
+
}
|
|
389
|
+
template<typename DEVICE>
|
|
390
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto abs_diff(DEVICE& device, const nn::layers::resnet_block::State&, const nn::layers::resnet_block::State&) { return 0; }
|
|
391
|
+
|
|
392
|
+
// ======================== reset_forward_state ========================
|
|
393
|
+
template<typename DEVICE, typename SPEC>
|
|
394
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE& device, nn::layers::resnet_block::LayerBackward<SPEC>& l) {
|
|
395
|
+
reset_forward_state(device, l.conv1);
|
|
396
|
+
reset_forward_state(device, l.conv2);
|
|
397
|
+
reset_forward_state(device, l.downsample);
|
|
398
|
+
}
|
|
399
|
+
template<typename DEVICE, typename SPEC>
|
|
400
|
+
RL_TOOLS_FUNCTION_PLACEMENT void reset_forward_state(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& l) {
|
|
401
|
+
reset_forward_state(device, static_cast<nn::layers::resnet_block::LayerBackward<SPEC>&>(l));
|
|
402
|
+
set_all(device, l.output, 0);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// ======================== is_nan ========================
|
|
406
|
+
template<typename DEVICE, typename SPEC, typename MODE = mode::Default<>>
|
|
407
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, const nn::layers::resnet_block::LayerForward<SPEC>& l, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
408
|
+
return is_nan(device, l.conv1, mode) || is_nan(device, l.conv2, mode) || is_nan(device, l.downsample, mode);
|
|
409
|
+
}
|
|
410
|
+
template<typename DEVICE, typename SPEC, typename MODE = mode::Default<>>
|
|
411
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, const nn::layers::resnet_block::LayerBackward<SPEC>& l, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
412
|
+
return is_nan(device, static_cast<const nn::layers::resnet_block::LayerForward<SPEC>&>(l), mode);
|
|
413
|
+
}
|
|
414
|
+
template<typename DEVICE, typename SPEC, typename MODE = mode::Default<>>
|
|
415
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE& device, const nn::layers::resnet_block::LayerGradient<SPEC>& l, const Mode<MODE>& mode = Mode<mode::Default<>>{}) {
|
|
416
|
+
return is_nan(device, static_cast<const nn::layers::resnet_block::LayerBackward<SPEC>&>(l), mode) || is_nan(device, l.output, mode);
|
|
417
|
+
}
|
|
418
|
+
template<typename DEVICE, typename MODE = mode::Default<>>
|
|
419
|
+
RL_TOOLS_FUNCTION_PLACEMENT bool is_nan(DEVICE&, nn::layers::resnet_block::State&, const Mode<MODE>& = Mode<mode::Default<>>{}) { return false; }
|
|
420
|
+
|
|
421
|
+
// ======================== output ========================
|
|
422
|
+
template<typename DEVICE, typename SPEC>
|
|
423
|
+
RL_TOOLS_FUNCTION_PLACEMENT auto output(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& l){
|
|
424
|
+
return view_memory<typename SPEC::OUTPUT_SHAPE>(device, l.output);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
428
|
+
#endif
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#if (defined(RL_TOOLS_DISABLE_INCLUDE_GUARDS) || !defined(RL_TOOLS_NN_LAYERS_RESNET_BLOCK_PERSIST_H)) && (RL_TOOLS_USE_THIS_VERSION == 1)
|
|
2
|
+
#pragma once
|
|
3
|
+
#define RL_TOOLS_NN_LAYERS_RESNET_BLOCK_PERSIST_H
|
|
4
|
+
#include "../../../version.h"
|
|
5
|
+
#include "layer.h"
|
|
6
|
+
#include "../conv2d/persist.h"
|
|
7
|
+
RL_TOOLS_NAMESPACE_WRAPPER_START
|
|
8
|
+
namespace rl_tools {
|
|
9
|
+
// ======================== DownsampleStorage save / load ========================
|
|
10
|
+
template<typename DEVICE, typename LAYER, typename GROUP>
|
|
11
|
+
void save(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, GROUP& group) {}
|
|
12
|
+
template<typename DEVICE, typename LAYER, typename GROUP>
|
|
13
|
+
bool load(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<false, LAYER>&, GROUP& group) { return true; }
|
|
14
|
+
template<typename DEVICE, typename LAYER, typename GROUP>
|
|
15
|
+
void save(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, GROUP& group) {
|
|
16
|
+
auto ds_group = create_group(device, group, "downsample");
|
|
17
|
+
save(device, ds.conv, ds_group);
|
|
18
|
+
}
|
|
19
|
+
template<typename DEVICE, typename LAYER, typename GROUP>
|
|
20
|
+
bool load(DEVICE& device, nn::layers::resnet_block::DownsampleStorage<true, LAYER>& ds, GROUP& group) {
|
|
21
|
+
if(group_exists(device, group, "downsample")){
|
|
22
|
+
auto ds_group = get_group(device, group, "downsample");
|
|
23
|
+
return load(device, ds.conv, ds_group);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ======================== Layer save / load ========================
|
|
29
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
30
|
+
void save(DEVICE& device, nn::layers::resnet_block::LayerForward<SPEC>& layer, GROUP& group) {
|
|
31
|
+
set_attribute(device, group, "type", "resnet_block");
|
|
32
|
+
write_attributes(device, group);
|
|
33
|
+
auto conv1_group = create_group(device, group, "conv1");
|
|
34
|
+
save(device, layer.conv1, conv1_group);
|
|
35
|
+
auto conv2_group = create_group(device, group, "conv2");
|
|
36
|
+
save(device, layer.conv2, conv2_group);
|
|
37
|
+
save(device, layer.downsample, group);
|
|
38
|
+
}
|
|
39
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
40
|
+
void save(DEVICE& device, nn::layers::resnet_block::LayerBackward<SPEC>& layer, GROUP& group) {
|
|
41
|
+
save(device, (nn::layers::resnet_block::LayerForward<SPEC>&)layer, group);
|
|
42
|
+
}
|
|
43
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
44
|
+
void save(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer, GROUP& group) {
|
|
45
|
+
save(device, (nn::layers::resnet_block::LayerBackward<SPEC>&)layer, group);
|
|
46
|
+
}
|
|
47
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
48
|
+
bool load(DEVICE& device, nn::layers::resnet_block::LayerForward<SPEC>& layer, GROUP& group) {
|
|
49
|
+
auto conv1_group = get_group(device, group, "conv1");
|
|
50
|
+
bool success = load(device, layer.conv1, conv1_group);
|
|
51
|
+
auto conv2_group = get_group(device, group, "conv2");
|
|
52
|
+
success &= load(device, layer.conv2, conv2_group);
|
|
53
|
+
success &= load(device, layer.downsample, group);
|
|
54
|
+
return success;
|
|
55
|
+
}
|
|
56
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
57
|
+
bool load(DEVICE& device, nn::layers::resnet_block::LayerBackward<SPEC>& layer, GROUP& group) {
|
|
58
|
+
return load(device, (nn::layers::resnet_block::LayerForward<SPEC>&)layer, group);
|
|
59
|
+
}
|
|
60
|
+
template<typename DEVICE, typename SPEC, typename GROUP>
|
|
61
|
+
bool load(DEVICE& device, nn::layers::resnet_block::LayerGradient<SPEC>& layer, GROUP& group) {
|
|
62
|
+
return load(device, (nn::layers::resnet_block::LayerBackward<SPEC>&)layer, group);
|
|
63
|
+
}
|
|
64
|
+
template<typename DEVICE, typename GROUP>
|
|
65
|
+
void save(DEVICE& device, nn::layers::resnet_block::State& state, GROUP& group) {}
|
|
66
|
+
template<typename DEVICE, typename GROUP>
|
|
67
|
+
bool load(DEVICE& device, nn::layers::resnet_block::State& state, GROUP& group) { return true; }
|
|
68
|
+
}
|
|
69
|
+
RL_TOOLS_NAMESPACE_WRAPPER_END
|
|
70
|
+
#endif
|