ncnn里面可以直接调用softmax函数,如下面
ncnn::Layer* softmax = ncnn::create_layer("Softmax");
ncnn::ParamDict pd;
pd.set(0, 1); // axis
pd.set(1, 1);
softmax->load_param(pd);
ncnn::Option opt;
opt.num_threads = 1;
本文介绍了如何在NCNN库中使用Softmax函数,重点分析了`forward_inplace`函数的工作原理,通过实例展示了对1x16向量进行softmax处理的过程,以及NCNN直接调用softmax后的结果。
ncnn里面可以直接调用softmax函数,如下面
ncnn::Layer* softmax = ncnn::create_layer("Softmax");
ncnn::ParamDict pd;
pd.set(0, 1); // axis
pd.set(1, 1);
softmax->load_param(pd);
ncnn::Option opt;
opt.num_threads = 1;

被折叠的 条评论
为什么被折叠?