-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrl_tools_inference_executor.cpp
More file actions
51 lines (43 loc) · 2.24 KB
/
Copy pathrl_tools_inference_executor.cpp
File metadata and controls
51 lines (43 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <rl_tools/operations/arm.h>
#include <rl_tools/nn/layers/standardize/operations_generic.h>
#include <rl_tools/nn/layers/dense/operations_arm/opt.h>
#include <rl_tools/nn/layers/sample_and_squash/operations_generic.h>
#include <rl_tools/nn/layers/gru/operations_generic.h>
#include <rl_tools/nn_models/mlp/operations_generic.h>
#include <rl_tools/nn_models/sequential/operations_generic.h>
#include <rl_tools/inference/executor/executor.h>
#include "external/blob/actor.h"
namespace rlt = rl_tools;
namespace other{
using DEV_SPEC = rlt::devices::DefaultARMSpecification;
using DEVICE = rlt::devices::arm::OPT<DEV_SPEC>;
}
struct RL_TOOLS_INFERENCE_APPLICATIONS_L2F_CONFIG{
using DEVICE = other::DEVICE;
using TI = typename other::DEVICE::index_t;
using RNG = other::DEVICE::SPEC::RANDOM::ENGINE<>;
static constexpr TI TEST_SEQUENCE_LENGTH_ACTUAL = 5;
static constexpr TI TEST_BATCH_SIZE_ACTUAL = 2;
using ACTOR_TYPE_ORIGINAL = rlt::checkpoint::actor::TYPE;
using POLICY_TEST = rlt::checkpoint::actor::TYPE::template CHANGE_BATCH_SIZE<TI, 1>::template CHANGE_SEQUENCE_LENGTH<TI, 1>;
using POLICY = ACTOR_TYPE_ORIGINAL::template CHANGE_BATCH_SIZE<TI, 1>::template CHANGE_SEQUENCE_LENGTH<TI, 1>;
using TYPE_POLICY = typename POLICY::SPEC::TYPE_POLICY;
using T = typename TYPE_POLICY::DEFAULT;
static auto& policy() {
return rlt::checkpoint::actor::module;
}
static constexpr TI ACTION_HISTORY_LENGTH = 1;
static constexpr TI CONTROL_INTERVAL_INTERMEDIATE_NS = 1 * 1000 * 1000; // Inference is at 500hz
static constexpr TI CONTROL_INTERVAL_NATIVE_NS = 10 * 1000 * 1000; // Training is 100hz
static constexpr TI TIMING_STATS_NUM_STEPS = 100;
static constexpr bool FORCE_SYNC_INTERMEDIATE = true;
static constexpr TI FORCE_SYNC_NATIVE = 10;
static constexpr bool FORCE_SYNC_NATIVE_RUNTIME = false;
static constexpr bool DYNAMIC_ALLOCATION = false;
struct WARNING_LEVELS: rlt::inference::executor::WarningLevelsDefault<TYPE_POLICY>{
static constexpr T INTERMEDIATE_TIMING_JITTER_HIGH_THRESHOLD = 1.3;
static constexpr T INTERMEDIATE_TIMING_JITTER_LOW_THRESHOLD = 0.7;
};
};
// #define RL_TOOLS_DISABLE_TEST
#include <rl_tools/inference/applications/l2f/c_backend.h>