shrinath-suresh/blogs-docs-splitted huggingface dataset:
for i in range(100):
             label_img[i]*=i/100.0
     writer.add_embedding(torch.randn(100, 5), metadata=meta, label_img=label_img)
     writer.add_embedding(torch.randn(100, 5), label_img=label_img)
     writer.add_embedding(torch.randn(100, 5), metadata=meta)

add_pr_curve(tag, labels, predictions, global_step=None, num_thresholds=127, weights=None, walltime=None)
  Adds precision recall curve. Plotting a precision-recall curve
  lets you understand your model's performance under different
  threshold settings. With this function, you provide the ground
  truth labeling (T/F) and prediction confidence (usually the
  output of your model) for each target. The TensorBoard UI will
  let you choose the threshold interactively.

  Parameters:
     * **tag** (*str*) -- Data identifier

     * **labels** (*torch.Tensor**, **numpy.ndarray**, or
       **string/blobname*) -- Ground truth data. Binary label for
       each element.
each element.
     * **predictions** (*torch.Tensor**, **numpy.ndarray**, or
       **string/blobname*) -- The probability that an element be
       classified as true. Value should be in [0, 1]

     * **global_step** (*int*) -- Global step value to record

     * **num_thresholds** (*int*) -- Number of thresholds used to
       draw the curve.

     * **walltime** (*float*) -- Optional override default
       walltime (time.time()) seconds after epoch of event

  Examples:

     from torch.utils.tensorboard import SummaryWriter
     import numpy as np
     labels = np.random.randint(2, size=100)  # binary label
     predictions = np.random.rand(100)
     writer = SummaryWriter()
     writer.add_pr_curve('pr_curve', labels, predictions, 0)
     writer.close()

add_custom_scalars(layout)
  Create special chart by collecting charts tags in 'scalars'.
  Note that this function can only be called once for each
SummaryWriter() object. Because it only provides metadata to
      tensorboard, the function can be called before or after the
      training loop.
  Parameters:
     **layout** (*dict*) -- {categoryName: *charts*}, where
     *charts* is also a dictionary {chartName:
     *ListOfProperties*}. The first element in *ListOfProperties*
     is the chart's type (one of **Multiline** or **Margin**) and
     the second element should be a list containing the tags you
     have used in add_scalar function, which will be collected
     into the new chart.

  Examples:

     layout = {'Taiwan':{'twse':['Multiline',['twse/0050', 'twse/2330']]},
                  'USA':{ 'dow':['Margin',   ['dow/aaa', 'dow/bbb', 'dow/ccc']],
                       'nasdaq':['Margin',   ['nasdaq/aaa', 'nasdaq/bbb', 'nasdaq/ccc']]}}

     writer.add_custom_scalars(layout)

add_mesh(tag, vertices, colors=None, faces=None, config_dict=None, global_step=None, walltime=None)
Add meshes or 3D point clouds to TensorBoard. The visualization
      is based on Three.js, so it allows users to interact with the
      rendered object. Besides the basic definitions such as vertices,
      faces, users can further provide camera parameter, lighting
      condition, etc. Please check https://threejs.org/docs/index.htm
      l#manual/en/introduction/Creating-a-scene for advanced usage.
  Parameters:
     * **tag** (*str*) -- Data identifier

     * **vertices** (*torch.Tensor*) -- List of the 3D coordinates
       of vertices.

     * **colors** (*torch.Tensor*) -- Colors for each vertex

     * **faces** (*torch.Tensor*) -- Indices of vertices within
       each triangle. (Optional)

     * **config_dict** -- Dictionary with ThreeJS classes names
       and configuration.

     * **global_step** (*int*) -- Global step value to record

     * **walltime** (*float*) -- Optional override default
walltime (time.time()) seconds after epoch of event
  Shape:
     vertices: (B, N, 3). (batch, number_of_vertices, channels)

     colors: (B, N, 3). The values should lie in [0, 255] for type
     *uint8* or [0, 1] for type *float*.

     faces: (B, N, 3). The values should lie in [0,
     number_of_vertices] for type *uint8*.

  Examples:

     from torch.utils.tensorboard import SummaryWriter
     vertices_tensor = torch.as_tensor([
         [1, 1, 1],
         [-1, -1, 1],
         [1, -1, -1],
         [-1, 1, -1],
     ], dtype=torch.float).unsqueeze(0)
     colors_tensor = torch.as_tensor([
         [255, 0, 0],
         [0, 255, 0],
         [0, 0, 255],
         [255, 0, 255],
     ], dtype=torch.int).unsqueeze(0)
     faces_tensor = torch.as_tensor([
         [0, 2, 3],
         [0, 3, 1],
         [0, 1, 2],
         [1, 3, 2],
     ], dtype=torch.int).unsqueeze(0)
], dtype=torch.int).unsqueeze(0)
     writer = SummaryWriter()
     writer.add_mesh('my_mesh', vertices=vertices_tensor, colors=colors_tensor, faces=faces_tensor)

     writer.close()

add_hparams(hparam_dict, metric_dict, hparam_domain_discrete=None, run_name=None)
  Add a set of hyperparameters to be compared in TensorBoard.

  Parameters:
     * **hparam_dict** (*dict*) -- Each key-value pair in the
       dictionary is the name of the hyper parameter and it's
       corresponding value. The type of the value can be one of
       *bool*, *string*, *float*, *int*, or *None*.

     * **metric_dict** (*dict*) -- Each key-value pair in the
       dictionary is the name of the metric and it's corresponding
       value. Note that the key used here should be unique in the
       tensorboard record. Otherwise the value you added by
       "add_scalar" will be displayed in hparam plugin. In most
       cases, this is unwanted.
cases, this is unwanted.
     * **hparam_domain_discrete** -- (Optional[Dict[str,
       List[Any]]]) A dictionary that contains names of the
       hyperparameters and all discrete values they can hold

     * **run_name** (*str*) -- Name of the run, to be included as
       part of the logdir. If unspecified, will use current
       timestamp.

  Examples:

     from torch.utils.tensorboard import SummaryWriter
     with SummaryWriter() as w:
         for i in range(5):
             w.add_hparams({'lr': 0.1*i, 'bsize': i},
                           {'hparam/accuracy': 10*i, 'hparam/loss': 10*i})

  Expected result:

  [image]

flush()
  Flushes the event file to disk. Call this method to make sure
  that all pending events have been written to disk.

close()