Commit 6177e85e authored by Khalique's avatar Khalique
Browse files

formatting

parent 2f65d247
......@@ -54,8 +54,8 @@ struct batch_norm_inference
struct lrn
{
float alpha = 0.0001;
float beta = 0.75;
float bias = 1.0;
float beta = 0.75;
float bias = 1.0;
int size;
std::string name() const { return "lrn"; }
......
......@@ -109,13 +109,13 @@ struct cpu_lrn
int height = output_shape.lens()[2];
int width = output_shape.lens()[3];
auto alphaoverarea = op.alpha / op.size;
auto radius = (op.size - 1) / 2;
auto radius = (op.size - 1) / 2;
dfor(n_batch, height, width)([&](int b, int h, int w){
dfor(n_batch, height, width)([&](int b, int h, int w) {
double scale = 0;
dfor(channels)([&](int c) {
auto start = (c - radius) < 0 ? 0 : (c - radius);
auto end = (c + radius) > channels ? channels : (c + radius);
auto end = (c + radius) > channels ? channels : (c + radius);
for(auto k = start; k < end; ++k)
{
......@@ -124,14 +124,13 @@ struct cpu_lrn
scale *= alphaoverarea;
scale += op.bias;
scale = std::pow(scale, -op.beta);
scale = std::pow(scale, -op.beta);
output(b, c, h, w) = input(b, c, h, w) * scale;
});
});
});
return result;
}
};
struct cpu_convolution
......
......@@ -22,7 +22,7 @@ using activation_descriptor = MIGRAPH_MANAGE_PTR(miopenActivationDescriptor_t,
using fusion_plan_descriptor = MIGRAPH_MANAGE_PTR(miopenFusionPlanDescriptor_t,
miopenDestroyFusionPlan);
using fused_operator_args = MIGRAPH_MANAGE_PTR(miopenOperatorArgs_t, miopenDestroyOperatorArgs);
using lrn_descriptor = MIGRAPH_MANAGE_PTR(miopenLRNDescriptor_t, miopenDestroyLRNDescriptor);
using lrn_descriptor = MIGRAPH_MANAGE_PTR(miopenLRNDescriptor_t, miopenDestroyLRNDescriptor);
template <class Result, class F, class... Ts>
Result make_obj(F f, Ts... xs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment