alpaca/alpacka/networks/keras.py
def train(self, data_stream):
        """Performs one epoch of training on data prepared by the Trainer.

        Args:
            data_stream: (Trainer-dependent) Python generator of batches to run
                the updates on.

        Returns:
            dict: Collected metrics, indexed by name.
        """

        dataset = tf.data.Dataset.from_generator(
            generator=data_stream,
            output_types=(self._model.input.dtype, self._model.output.dtype)
        )

        # WA for bug: https://github.com/tensorflow/tensorflow/issues/32912
        history = self._model.fit_generator(dataset, epochs=1, verbose=0,
                                            callbacks=self.train_callbacks)
        # history contains epoch-indexed sequences. We run only one epoch, so
        # we take the only element.
        return {name: values[0] for (name, values) in history.history.items()}
Performs one epoch of training on data prepared by the Trainer.

        Args:
            data_stream: (Trainer-dependent) Python generator of batches to run
                the updates on.

        Returns:
            dict: Collected metrics, indexed by name.
        
Performs one epoch of training on data prepared by the Trainer.
Performs one epoch of training on data prepared by the Trainer .
def train(self, data_stream):
        dataset = tf.data.Dataset.from_generator(
            generator=data_stream,
            output_types=(self._model.input.dtype, self._model.output.dtype)
        )
        history = self._model.fit_generator(dataset, epochs=1, verbose=0,
                                            callbacks=self.train_callbacks)
        return {name: values[0] for (name, values) in history.history.items()}
def train ( self , data_stream ) : dataset = tf . data . Dataset . from_generator ( generator = data_stream , output_types = ( self . _model . input . dtype , self . _model . output . dtype ) ) history = self . _model . fit_generator ( dataset , epochs = 1 , verbose = 0 , callbacks = self . train_callbacks ) return { name : values [ 0 ] for ( name , values ) in history . history . items ( ) }
Performs one epoch of training on data prepared by the Trainer.
Performs one epoch of training on data prepared by the Trainer .
"""Performs one epoch of training on data prepared by the Trainer.

        Args:
            data_stream: (Trainer-dependent) Python generator of batches to run
                the updates on.

        Returns:
            dict: Collected metrics, indexed by name.
        """ # WA for bug: https://github.com/tensorflow/tensorflow/issues/32912 # history contains epoch-indexed sequences. We run only one epoch, so # we take the only element.
Collected metrics, indexed by name.
Collected metrics indexed by name .
dict
self
data_stream
(Trainer-dependent) Python generator of batches to run
the updates on.
( Trainer - dependent ) Python generator of batches to run the updates on .