In Encoder.encode, catch AttributeError if model lacks an encode method
and try calling fprop instead.
In pylearnutils.costs.nearest_neighbor, catch AttributeError if the
model lacks an encode method, then call model.fprop instead.