Comstum Neural network

Hi there,

I want to make a neural network that can be as following form:

NN_new = \alpha * NN(X) + (1 - \alpha) Linear(X)

in which alpha is also being trained simultaneously as well. NN(X) is the neural network with nonlinear activation function that can predict the nonlinear part of my function and Linear (X) can be another network with linear activation function.
Any idea how I can make it in tensorflow?

Hi @kiarash,

Apologize for the delay in response.
You can create custom neural network as above in tensorflow by creating custom layers(i.e. linear and non linear layers).Here’s a sample implementation gist for your reference and I recommend to check out this documentation about custom layers for more information.

Thank You.