MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _process_inputs

Function _process_inputs

tensorflow/python/keras/engine/training_v2.py:585–625  ·  view source on GitHub ↗

Process the inputs for fit/eval/predict().

(model,
                    x,
                    y,
                    batch_size=None,
                    epochs=1,
                    sample_weights=None,
                    class_weights=None,
                    shuffle=False,
                    steps=None,
                    distribution_strategy=None,
                    max_queue_size=10,
                    workers=1,
                    use_multiprocessing=False)

Source from the content-addressed store, hash-verified

583
584
585def _process_inputs(model,
586 x,
587 y,
588 batch_size=None,
589 epochs=1,
590 sample_weights=None,
591 class_weights=None,
592 shuffle=False,
593 steps=None,
594 distribution_strategy=None,
595 max_queue_size=10,
596 workers=1,
597 use_multiprocessing=False):
598 """Process the inputs for fit/eval/predict()."""
599 adapter_cls = data_adapter.select_data_adapter(x, y)
600 if adapter_cls in _ADAPTER_FOR_STANDARDIZE_USER_DATA:
601 x, y, sample_weights = model._standardize_user_data(
602 x,
603 y,
604 sample_weight=sample_weights,
605 class_weight=class_weights,
606 batch_size=batch_size,
607 check_steps=False,
608 steps=steps)
609 adapter = adapter_cls(
610 x,
611 y,
612 batch_size=batch_size,
613 epochs=epochs,
614 steps=steps,
615 sample_weights=sample_weights,
616 shuffle=shuffle,
617 distribution_strategy=distribution_strategy,
618 max_queue_size=max_queue_size,
619 workers=workers,
620 use_multiprocessing=use_multiprocessing)
621 # As a fallback for the data type that does not work with
622 # _standardize_user_data, use the _prepare_model_with_inputs.
623 if adapter_cls not in _ADAPTER_FOR_STANDARDIZE_USER_DATA:
624 training_v2_utils._prepare_model_with_inputs(model, adapter.get_dataset())
625 return adapter
626
627
628def _get_total_number_of_samples(adapter):

Callers 2

_model_iterationMethod · 0.85
_process_training_inputsFunction · 0.85

Calls 2

get_datasetMethod · 0.45

Tested by

no test coverage detected