zoukankan      html  css  js  c++  java
  • frugally-deep: Header-only library for using Keras models in C++

        // Convenience wrapper around predict for models with
        // single tensor outputs of shape (1, 1, 1),
        // typically used for regression or binary classification.
        // Returns this one activation value.
        float_type predict_single_output(const tensor5s& inputs) const
        {
            const tensor5s outputs = predict(inputs);
            internal::assertion(outputs.size() == 1,
                "invalid number of outputs");
            const auto output_shape = outputs.front().shape();
            internal::assertion(output_shape.volume() == 1,
                "invalid output shape");
            return outputs.front().get(0, 0, 0, 0, 0);
    }
    

    convert tensor5 datatype to std::vector

    const std::vector<float> result_vec = *result.front().as_vector();
    
  • 相关阅读:
    结构型模式(一) 适配器模式
    选择器
    CSS引入
    CSS语法
    CSS介绍
    HTML练习
    HTML标签嵌套规则(重点)
    HTML标签分类(重点)
    HTML标签属性
    body标签
  • 原文地址:https://www.cnblogs.com/yaos/p/10526907.html
Copyright © 2011-2022 走看看