#include <rand_ctx.h>
Non-template base class for RandCtx
◆ observeTrace()
| void freetensor::RandCtxImpl::observeTrace |
( |
const Ref< RandTrace > & |
trace, |
|
|
double |
value, |
|
|
double |
stddev |
|
) |
| |
Learn from a trace
This trace is compared with existing traces. For each two trace being compared, the first different decision will be found, whose random variable will be upadated to perfer the decision from the trace of the lower value
This function must be called from the master thread
◆ setInfer()
| void freetensor::RandCtxImpl::setInfer |
( |
| ) |
|
|
inline |
When decide later, pick a most likely decision
This function must be called from the master thread
◆ setLearn()
| void freetensor::RandCtxImpl::setLearn |
( |
| ) |
|
|
inline |
When decide later, randomly sample a decision
This function must be called from the master thread
◆ setLearnFilter()
| void freetensor::RandCtxImpl::setLearnFilter |
( |
const std::regex & |
toLearn | ) |
|
|
inline |
Set to learn some of the random variables only
A pattern can be set, and then only the variables matching this pattern is set to learning. This is useful when testing some of the random decisions with few learning trials
This function must be called from the master thread
◆ isInfer_
| bool freetensor::RandCtxImpl::isInfer_ = true |
|
protected |
◆ lock_
| std::mutex freetensor::RandCtxImpl::lock_ |
|
protected |
◆ randVars_
◆ toLearn_
| std::regex freetensor::RandCtxImpl::toLearn_ {".*"} |
|
protected |
◆ totCnt_
| std::unordered_map<ProgramPosition, Ref<std::vector<int> > > freetensor::RandCtxImpl::totCnt_ |
|
protected |
◆ traces_
The documentation for this class was generated from the following files: