Skip to content

Commit

Permalink
Fix some abstract class stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvm committed Jan 17, 2015
1 parent 856c5de commit 19e306a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion blocks/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def process_batch(self, batch):
pass


@add_metaclass(ABCMeta)
class DifferentiableCostMinimizer(TrainingAlgorithm):
"""Minimizes a differentiable cost given as a Theano expression.
Expand Down Expand Up @@ -184,6 +183,7 @@ def process_batch(self, batch):
self._function(*ordered_batch)


@add_metaclass(ABCMeta)
class StepRule(object):
"""A rule to compute a step for a gradient descent algorithm."""
@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion blocks/bricks/sequence_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from blocks.utils import dict_subset, dict_union, update_instance


@add_metaclass(ABCMeta)
class BaseSequenceGenerator(Initializable):
"""A generic sequence generator.
Expand Down Expand Up @@ -243,6 +242,7 @@ def initial_state(self, name, batch_size, *args, **kwargs):
assert False


@add_metaclass(ABCMeta)
class AbstractEmitter(Brick):
"""The interface for the emitter component of a readout."""
@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion blocks/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def get_default_stream(self):
return DataStream(self, iteration_scheme=self.default_scheme)


@add_metaclass(ABCMeta)
class ContainerDataset(Dataset):
"""Equips a Python container with the dataset interface.
Expand Down Expand Up @@ -173,6 +172,7 @@ def get_data(self, state, request=None):
return next(state)


@add_metaclass(ABCMeta)
class AbstractDataStream(object):
"""A stream of data separated into epochs.
Expand Down
5 changes: 0 additions & 5 deletions blocks/main_loop.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
"""The event-based main loop of Blocks."""
from abc import ABCMeta

from six import add_metaclass

from blocks.log import TrainingLog
from blocks.utils import update_instance


@add_metaclass(ABCMeta)
class MainLoop(object):
"""The standard main loop of Blocks.
Expand Down

0 comments on commit 19e306a

Please sign in to comment.