tiny-dnn
tiny-dnn copied to clipboard
how to write customised layer?
I try to write a customised layer, I begin with copy power_layer as power_layer_a and prodceed following step:
-
replace every
power_layerwithpower_layer_ainpower_layer_a -
add
#include "tiny_dnn/layers/power_layer_a.h"inlayers.h -
add
using power_a = tiny_dnn::power_layer_a;undernamespace tiny_dnnintiny_dnn.h
But I can't use power_layer_a in main program with using pow = tiny_dnn::power_layer_a;, what should I do?
have you figure out this problem? and i have the same demand
Look at https://github.com/tiny-dnn/tiny-dnn/pull/1014. Or fork directly at https://github.com/dmilos/tiny-dnn. Then overwrite files in your fork and search/replace softclip with your layer's name.
Here are in brief how to add new layer:
-
Modify: test/test.cpp
-
Modify: test/test_serialization.cpp
-
Modify: tiny_dnn/tiny_dnn.h
-
Modify: tiny_dnn/utils/serialization_functions.h
-
Modify: tiny_dnn/utils/serialization_layer_list.h
-
Create: test/test_my_special_layer_list.h
-
Create: tiny_dnn/activations/my_special_layer_list.h
-
Modify: AUTORS and REAME.md