载入中...
搜索中...
未找到
BalanceBindings.cpp
浏览该文件的文档.
17 ScriptEvaluator(const ssq::Table& table, const Problem& problem) : table_(table), problem_(problem) {}
18 Result<std::vector<double>> evaluate(std::span<const double> parameters, std::uint64_t seed, double dt,
24 if (SQ_FAILED(sq_get(vm, -2))) return fail("Missing evaluate(parameters, seed, dt, steps) method");
36 script::callFunctionResult(vm, function, table_, arguments, seedText, SQFloat(dt), SQInteger(steps)))) {
64 Diagnostic::error(DiagnosticCode::CallbackFailure, std::move(message), {}, {}, "agent.balance.script"));
100 return script::projectResult(vm, Result<Value>::failure(checked.status()), [](Value v) { return v; });
The single Squirrel projection for common Result, Status and Value.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Configure-then-run builder for bounded black-box numerical balancing. @ownership Owns configuration; ...
Definition Balance.h:108
static void expose(ssq::Table &table)
Register the VM-owned builder in the Agent script surface; composition thread only.
Definition BalanceBindings.cpp:71
BalanceSearch()=default
Create an unconfigured search builder.
Result< void > configure(const Problem &problem)
Validate and copy a problem atomically; a failed configuration preserves the previous one.
Definition Balance.cpp:92
Result< Report > run(IEvaluator &evaluator)
Search on training seeds, then assess initial and best parameters on untouched holdout seeds.
Definition Balance.cpp:99
Definition Balance.cpp:9
Result< Problem > decodeProblem(const Value &value)
Decode version-1 problem data; reject unknown schema/version/fields and invalid types.
Definition BalanceCodec.cpp:100
Value encodeBalanceReport(const Report &r)
Project an owning version-1 evidence report, including the full reproduction specification....
Definition BalanceCodec.cpp:139
Result< T > fail(std::string message, DiagnosticCode code=DiagnosticCode::InvalidArgument)
Definition BuildingAssemblyInternal.h:35
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:27
SQRESULT callFunctionResult(HSQUIRRELVM vm, const HSQOBJECT &fn, const Receiver &receiver, Args &&... args)
callFunction() that keeps the return value on top for the caller to read.
Definition SquirrelBinding.h:240
Result< void > pushValue(HSQUIRRELVM vm, const Value &value, const SquirrelValueOptions &options)
Push a canonical Value into the active Squirrel VM.
Definition SquirrelBinding.cpp:439
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
Result< Value > valueFromSquirrel(HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options)
Convert one Squirrel value into the canonical owning Value tree.
Definition SquirrelBinding.cpp:412
std::vector< OnnxNamedTensor > evaluate(const ModelData &, std::span< const OnnxNamedTensor >, const std::vector< std::string > &, OnnxCompute *, OnnxRunOptions options)
Evaluate.
Definition OnnxQuant.cpp:969
@ InvalidArgument
@ CallbackFailure