fl_server_core.models.metric ¶
Classes:
| Name | Description |
|---|---|
Metric | Metric model class. |
Classes¶
Metric ¶
Bases: Model
flowchart TD
fl_server_core.models.metric.Metric[Metric]
click fl_server_core.models.metric.Metric href "" "fl_server_core.models.metric.Metric"
Metric model class.
- API Reference
fl_server_apiserializersgeneric AttributesMetricSerializer
Methods:
| Name | Description |
|---|---|
is_binary | Check if the value of the metric is binary. |
is_float | Check if the value of the metric is a float. |
to_torch | Convert the binary value of the metric to a torch module or tensor. |
Attributes:
| Name | Type | Description |
|---|---|---|
identifier | CharField | Identifier of the metric. |
key | CharField | Key of the metric. |
model | ForeignKey | Model associated with the metric. |
reporter | ForeignKey | User who reported the metric. |
step | IntegerField | Step of the metric. |
value | float | bytes | Value of the metric. |
value_binary | BinaryField | Binary value of the metric. |
value_float | FloatField | Float value of the metric. |
Source code in fl_server_core/models/metric.py
Attributes¶
identifier class-attribute instance-attribute ¶
Identifier of the metric.
key class-attribute instance-attribute ¶
Key of the metric.
model class-attribute instance-attribute ¶
model: ForeignKey = ForeignKey(Model, on_delete=CASCADE)
Model associated with the metric.
reporter class-attribute instance-attribute ¶
reporter: ForeignKey = ForeignKey(User, null=True, blank=True, on_delete=CASCADE)
User who reported the metric.
step class-attribute instance-attribute ¶
Step of the metric.
value deletable property writable ¶
value_binary class-attribute instance-attribute ¶
Binary value of the metric.
value_float class-attribute instance-attribute ¶
Float value of the metric.
Functions¶
is_binary ¶
is_binary() -> bool
Check if the value of the metric is binary.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool |
|
is_float ¶
is_float() -> bool
Check if the value of the metric is a float.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool |
|
to_torch ¶
Convert the binary value of the metric to a torch module or tensor.
Returns:
| Type | Description |
|---|---|
Module | Tensor | Module | Tensor: The converted torch module or tensor. |