def train_autoencoder(hidden_units, training_data):
 autoencoder_training_data = [(x, x) for (x, _) in training_data]
 net = Network([784, hidden_units, 784])
 net.SGD(autoencoder_training_data, 6, 10, 0.01, 0.05)
 return net

def train_autoencoder ( hidden_units , training_data ) : autoencoder_training_data = [ ( x , x ) for ( x , _ ) in training_data ] net = Network ( [ 784 , hidden_units , 784 ] ) net . SGD ( autoencoder_training_data , 6 , 10 , 0.01 , 0.05 ) return net
return a trained autoencoder .