TuningSnapshot.fromJson constructor

TuningSnapshot.fromJson(
  1. Object? j
)

Implementation

factory TuningSnapshot.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return TuningSnapshot(
    step: switch (json['step']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    epoch: switch (json['epoch']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
    meanLoss: switch (json['meanLoss']) {
      null => 0,
      Object $1 => decodeDouble($1),
    },
    computeTime: switch (json['computeTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
  );
}