# Module containing functions to compile and differentiate Theano graphs.

import theano.tensor as T
import theano

# Compile objective function defined in Theano.
def compile(objective, argument):
    return theano.function([argument], objective)

# Compute the gradient of 'objective' with respect to 'argument' and return
# compiled function.
def gradient(objective, argument):
    g = T.grad(objective, argument)
    return theano.function([argument], g)
# Module containing functions to compile and differentiate Theano graphs.

import theano.tensor as T
import theano

# Compile objective function defined in Theano.
def compile(objective, argument):
    return theano.function([argument], objective)

# Compute the gradient of 'objective' with respect to 'argument' and return
# compiled function.
def gradient(objective, argument):
    g = T.grad(objective, argument)
    return compile(g, argument)


Use `compile` function for `gradient` function
Use `compile` function for `gradient` function

Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>
