def _setup_vars(self, sparse_input):
'''Setup Theano variables for our network.
Parameters
----------
sparse_input : bool
Unused -- theanets does not support autoencoders with sparse input.
Returns
-------
vars : list of theano variables
A list of the variables that this network requires as inputs.
'''
assert not sparse_input, 'Theanets does not support sparse autoencoders!'
# x represents our network's input (and target outputs).
self.x = TT.matrix('x')
# the weight array is provided to ensure that different target values
# are taken into account with different weights during optimization.
self.weights = TT.matrix('weights')
if self.weighted:
return [self.x, self.weights]
return [self.x]
评论列表
文章目录