SupervisedTuningSpec.fromJson constructor

SupervisedTuningSpec.fromJson(
  1. Object? j
)

Implementation

factory SupervisedTuningSpec.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return SupervisedTuningSpec(
    trainingDatasetUri: switch (json['trainingDatasetUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    validationDatasetUri: switch (json['validationDatasetUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    hyperParameters: switch (json['hyperParameters']) {
      null => null,
      Object $1 => SupervisedHyperParameters.fromJson($1),
    },
    exportLastCheckpointOnly: switch (json['exportLastCheckpointOnly']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    evaluationConfig: switch (json['evaluationConfig']) {
      null => null,
      Object $1 => EvaluationConfig.fromJson($1),
    },
    tuningMode: switch (json['tuningMode']) {
      null => SupervisedTuningSpec_TuningMode.$default,
      Object $1 => SupervisedTuningSpec_TuningMode.fromJson($1),
    },
  );
}