tensorflow2.x学习笔记二十四:tf.keras.metrics的使用

一、metrics的简单介绍

       在tensorflow2.x中我们进行模型编译的时候,会看到其中有一个参数是metrics,它用来在训练过程中监测一些性能指标,而这个性能指标是什么可以由我们来指定。指定的方法有两种:

  • 直接使用字符串
  • 使用tf.keras.metrics下的类创建的实例化对象或者函数

下面先举个例子来看一下这两种方式:


model.compile(loss='mean_squared_error',
              optimizer='sgd',
              metrics=['ce',

你可能感兴趣的:(#,深度学习,tensorflow,人工智能)