TensorBoard in R
Note
You can follow along with the code in the Jupyter R notebook ch-17d_TensorBoard_in_R
.
You can view the TensorBoard with the tensorboard()
function as follows:
tensorboard('logs')
Here, 'logs'
is the folder where the TensorBoard logs should be created.
The data will be shown as the epochs execute and the data is recorded. In R, collecting the data for TensorBoard depends on the package being used:
- If you are using the
tensorflow
package, then attach thetf$summary$scalar
operations to the graph - If you are using the
tfestimators
package, then TensorBoard data is automatically written to themodel_dir
parameter that is specified while creating the estimator - If you are using the
keras
package, then you have to include thecallback_tensorboard()
function while training the model using thefit()
function
We modify the training in the Keras example provided earlier as follows:
# Training the model -------- tensorboard("logs") history <- model %>% fit( x_train, y_train, ...