Returns the loss value & metrics values for the model in test mode. Computation is done in batches. Arguments: x: Input data. It could be: - A Numpy array (or array-like), or a list of arrays (in case the model has multiple inputs). - A TensorFlow te
(self,
x=None,
y=None,
batch_size=None,
verbose=1,
sample_weight=None,
steps=None,
callbacks=None,
max_queue_size=10,
workers=1,
use_multiprocessing=False)
| 727 | use_multiprocessing=use_multiprocessing) |
| 728 | |
| 729 | def evaluate(self, |
| 730 | x=None, |
| 731 | y=None, |
| 732 | batch_size=None, |
| 733 | verbose=1, |
| 734 | sample_weight=None, |
| 735 | steps=None, |
| 736 | callbacks=None, |
| 737 | max_queue_size=10, |
| 738 | workers=1, |
| 739 | use_multiprocessing=False): |
| 740 | """Returns the loss value & metrics values for the model in test mode. |
| 741 | |
| 742 | Computation is done in batches. |
| 743 | |
| 744 | Arguments: |
| 745 | x: Input data. It could be: |
| 746 | - A Numpy array (or array-like), or a list of arrays |
| 747 | (in case the model has multiple inputs). |
| 748 | - A TensorFlow tensor, or a list of tensors |
| 749 | (in case the model has multiple inputs). |
| 750 | - A dict mapping input names to the corresponding array/tensors, |
| 751 | if the model has named inputs. |
| 752 | - A `tf.data` dataset. |
| 753 | - A generator or `keras.utils.Sequence` instance. |
| 754 | y: Target data. Like the input data `x`, |
| 755 | it could be either Numpy array(s) or TensorFlow tensor(s). |
| 756 | It should be consistent with `x` (you cannot have Numpy inputs and |
| 757 | tensor targets, or inversely). |
| 758 | If `x` is a dataset, generator or |
| 759 | `keras.utils.Sequence` instance, `y` should not be specified (since |
| 760 | targets will be obtained from the iterator/dataset). |
| 761 | batch_size: Integer or `None`. |
| 762 | Number of samples per gradient update. |
| 763 | If unspecified, `batch_size` will default to 32. |
| 764 | Do not specify the `batch_size` is your data is in the |
| 765 | form of symbolic tensors, dataset, |
| 766 | generators, or `keras.utils.Sequence` instances (since they generate |
| 767 | batches). |
| 768 | verbose: 0 or 1. Verbosity mode. |
| 769 | 0 = silent, 1 = progress bar. |
| 770 | sample_weight: Optional Numpy array of weights for |
| 771 | the test samples, used for weighting the loss function. |
| 772 | You can either pass a flat (1D) |
| 773 | Numpy array with the same length as the input samples |
| 774 | (1:1 mapping between weights and samples), |
| 775 | or in the case of temporal data, |
| 776 | you can pass a 2D array with shape |
| 777 | `(samples, sequence_length)`, |
| 778 | to apply a different weight to every timestep of every sample. |
| 779 | In this case you should make sure to specify |
| 780 | `sample_weight_mode="temporal"` in `compile()`. This argument is not |
| 781 | supported when `x` is a dataset, instead pass |
| 782 | sample weights as the third element of `x`. |
| 783 | steps: Integer or `None`. |
| 784 | Total number of steps (batches of samples) |
| 785 | before declaring the evaluation round finished. |
| 786 | Ignored with the default value of `None`. |