Add Cost.is_stochastic to make warning more selective

SGTM

On Thu, Nov 13, 2014 at 6:17 PM, Ian Goodfellow <notifications@github.com>
wrote:

> In pylearn2/costs/cost.py:
>
> > @@ -222,6 +222,25 @@ def get_data_specs(self, model):
> >          raise NotImplementedError(str(type(self)) + " does not implement " +
> >                                    "get_data_specs.")
> >
> > +    def is_stochastic(self):
> > +        """
> > +        Returns True if the cost is stochastic.
> > +
> > +        Stochastic costs are incompatible with some optimization algorithms
>
> I think this is a valid "extended summary" section of the docstring,
> because it clarifies the functionality of the interface. The "Notes"
> section is for details about the implementation of a function, such as
> mathematical formulas.
>
> https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#method-docstrings
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/lisa-lab/pylearn2/pull/1237/files#r20331554>.
>