docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class StatsRecorder

    Add stats (key-value pairs) for reporting. These values will sent these to a StatsReporter instance, which means the values will appear in the TensorBoard summary, as well as trainer gauges. You can nest stats in TensorBoard by adding "/" in the name (e.g. "Agent/Health" and "Agent/Wallet"). Note that stats are only written to TensorBoard each summary_frequency steps (a trainer configuration). If a stat is received multiple times, within that period then the values will be aggregated using the StatAggregationMethod provided.

    Inheritance
    object
    StatsRecorder
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MLAgents
    Assembly: Unity.ML-Agents.dll
    Syntax
    public sealed class StatsRecorder

    Methods

    Add(string, float, StatAggregationMethod)

    Add a stat value for reporting.

    Declaration
    public void Add(string key, float value, StatAggregationMethod aggregationMethod = StatAggregationMethod.Average)
    Parameters
    Type Name Description
    string key

    The stat name.

    float value

    The stat value. You can nest stats in TensorBoard by using "/".

    StatAggregationMethod aggregationMethod

    How multiple values sent in the same summary window should be treated.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)