Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 603 Bytes
import theano, theano.tensor as T
import numpy as np
from data import noteStateSingleToInputForm
class OutputFormToInputFormOp(theano.Op):
# Properties attribute
__props__ = ()
def make_node(self, state, time):
state = T.as_tensor_variable(state)
time = T.as_tensor_variable(time)
return theano.Apply(self, [state, time], [T.bmatrix()])
# Python implementation:
def perform(self, node, inputs_storage, output_storage):
state, time = inputs_storage
output_storage[0][0] = np.array(noteStateSingleToInputForm(state, time), dtype='int8')