def test_high_order_autoencoder_init():
 corruptor = BinomialCorruptor(corruption_level=0.5)
 model = HigherOrderContractiveAutoencoder(corruptor=corruptor, num_corruptions=2, nvis=5, nhid=7, act_enc='sigmoid', act_dec='sigmoid')
 X = tensor.matrix()
 data = np.random.randn(10, 5).astype(config.floatX)
 ff = theano.function([X], model.higher_order_penalty(X))
 assert (type(ff(data)) == np.ndarray)

def test_high_order_autoencoder_init ( ) : corruptor = BinomialCorruptor ( corruption_level = 0.5 ) model = HigherOrderContractiveAutoencoder ( corruptor = corruptor , num_corruptions = 2 , nvis = 5 , nhid = 7 , act_enc = 'sigmoid' , act_dec = 'sigmoid' ) X = tensor . matrix ( ) data = np . random . randn ( 10 , 5 ) . astype ( config . floatX ) ff = theano . function ( [ X ] , model . higher_order_penalty ( X ) ) assert ( type ( ff ( data ) ) == np . ndarray )
just test that model initialize and return the penalty without error .