class_docstr: Accepts any number of of `MonitorTaskGroup` instances, and runs them
  according to their specified periodicity.
  
  Example use-case::
  
      # Create some monitor tasks
      log_dir = "logs"
      model_task = ModelToTensorBoard(log_dir, model)
      image_task = ImageToTensorBoard(log_dir, plot_prediction, "image_samples")
      lml_task = ScalarToTensorBoard(log_dir, lambda: model.log_marginal_likelihood(), "lml")
  
      # Plotting tasks can be quite slow, so we want to run them less frequently.
      # We group them in a `MonitorTaskGroup` and set the period to 5.
      slow_tasks = MonitorTaskGroup(image_task, period=5)
  
      # The other tasks are fast. We run them at each iteration of the optimisation.
      fast_tasks = MonitorTaskGroup([model_task, lml_task], period=1)
  
      # We pass both groups to the `Monitor`
      monitor = Monitor(fast_tasks, slow_tasks)
class_docstr_tok: ["Accepts","any","number","of","of","`","MonitorTaskGroup","`","instances",",","and","runs","them","according","to","their","specified","periodicity",".","Example","use-case",":",":","#","Create","some","monitor","tasks","log_dir","=","``","logs","''","model_task","=","ModelToTensorBoard","(","log_dir",",","model",")","image_task","=","ImageToTensorBoard","(","log_dir",",","plot_prediction",",","``","image_samples","''",")","lml_task","=","ScalarToTensorBoard","(","log_dir",",","lambda",":","model.log_marginal_likelihood","(",")",",","``","lml","''",")","#","Plotting","tasks","can","be","quite","slow",",","so","we","want","to","run","them","less","frequently",".","#","We","group","them","in","a","`","MonitorTaskGroup","`","and","set","the","period","to","5.","slow_tasks","=","MonitorTaskGroup","(","image_task",",","period=5",")","#","The","other","tasks","are","fast",".","We","run","them","at","each","iteration","of","the","optimisation",".","fast_tasks","=","MonitorTaskGroup","(","[","model_task",",","lml_task","]",",","period=1",")","#","We","pass","both","groups","to","the","`","Monitor","`","monitor","=","Monitor","(","fast_tasks",",","slow_tasks",")"]
docstr: :param task_groups: a list of `MonitorTaskGroup`s to be executed.
docstr_tok: [":","param","task_groups",":","a","list","of","`","MonitorTaskGroup","`","s","to","be","executed","."]
code: def __init__(self, *task_groups: MonitorTaskGroup) -> None:
      """
      :param task_groups: a list of `MonitorTaskGroup`s to be executed.
      """
      self.task_groups = task_groups
  
file_path: GPflow/gpflow/monitor/base.py
imports: from abc import ABC, abstractmethod
  from typing import Any, Callable, Collection, Union
  import tensorflow
label_desc: Use image node_id 1 to create a new Monitor object  with example: obj = Monitor()