本文整理汇总了C++中ConfigParameters::find方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigParameters::find方法的具体用法?C++ ConfigParameters::find怎么用?C++ ConfigParameters::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigParameters
的用法示例。
在下文中一共展示了ConfigParameters::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateTransforms
// Create transformers based on the configuration, i.e.
// deserializers = [
// [
// type = "ImageDataDeserializer"
// module = "ImageReader"
// input = [
// features = [
//----> transforms = [
// [type = "Crop"]:[type = "Scale"]...
void CompositeDataReader::CreateTransforms(const ConfigParameters& deserializerConfig)
{
std::string defaultModule = deserializerConfig("module");
if (!deserializerConfig.Exists("input"))
return;
const ConfigParameters& inputs = deserializerConfig("input");
for (const pair<string, ConfigParameters>& section : inputs)
{
ConfigParameters inputBody = section.second;
// Trying to find transforms in the input section of the config.
if (inputBody.find("transforms") == inputBody.end())
continue;
std::wstring inputName = Microsoft::MSR::CNTK::ToFixedWStringFromMultiByte(section.first);
// Read transformers in order and appending them to the transformer pipeline.
argvector<ConfigParameters> transforms = inputBody("transforms");
for (size_t j = 0; j < transforms.size(); ++j)
{
ConfigParameters p = transforms[j];
p.Insert("precision", deserializerConfig("precision"));
TransformerPtr transformer = CreateTransformer(p, defaultModule, std::wstring());
m_transforms.push_back(Transformation{ transformer, inputName });
}
// Let's add a cast transformer by default. It is noop if the type provided by others is float
// or double, but will do a proper cast if the type is uchar.
auto cast = CreateTransformer(inputBody, defaultModule, std::wstring(L"Cast"));
m_transforms.push_back(Transformation{ cast, inputName });
}
}