Models

[source]

Regressor

polyaxon.models.regressors.Regressor(mode, graph_fn, loss_config=None, optimizer_config=None, eval_metrics_config=None, summaries='all', clip_gradients=0.5, clip_embed_gradients=0.1, name='Regressor')

Regressor base model.

  • Args:

    • mode: str, Specifies if this training, evaluation or prediction. See Modes. Possible values: regressor, classifier, generator
    • graph_fn: Graph function. Follows the signature:
      • Args:
      • mode: Specifies if this training, evaluation or prediction. See Modes.
      • inputs: the feature inputs.
    • loss_config: An instance of LossConfig. Default value mean_squared_error.
    • optimizer_config: An instance of OptimizerConfig. Default value Adam.
    • eval_metrics_config: a list of MetricConfig instances.
    • summaries: str or list. The verbosity of the tensorboard visualization. Possible values: all, activations, loss, learning_rate, variables, gradients
    • clip_gradients: float. Gradients clipping by global norm.
    • clip_embed_gradients: float. Embedding gradients clipping to a specified value.
    • name: str, the name of this model, everything will be encapsulated inside this scope.
  • Returns: EstimatorSpec


[source]

Classifier

polyaxon.models.classifiers.Classifier(mode, graph_fn, loss_config=None, optimizer_config=None, summaries='all', eval_metrics_config=None, clip_gradients=0.5, clip_embed_gradients=0.1, one_hot_encode=None, n_classes=None, name='Classfier')

Regressor base model.

  • Args:

    • mode: str, Specifies if this training, evaluation or prediction. See Modes. Possible values: regressor, classifier, generator
    • graph_fn: Graph function. Follows the signature:
      • Args:
      • mode: Specifies if this training, evaluation or prediction. See Modes.
      • inputs: the feature inputs.
    • loss_config: An instance of LossConfig. Default value sigmoid_cross_entropy.
    • optimizer_config: An instance of OptimizerConfig. Default value Adam.
    • eval_metrics_config: a list of MetricConfig instances.
    • summaries: str or list. The verbosity of the tensorboard visualization. Possible values: all, activations, loss, learning_rate, variables, gradients
    • clip_gradients: float. Gradients clipping by global norm.
    • clip_embed_gradients: float. Embedding gradients clipping to a specified value.
    • one_hot_encode: bool. to one hot encode the outputs.
    • n_classes: int. The number of classes used in the one hot encoding.
    • name: str, the name of this model, everything will be encapsulated inside this scope.
  • Returns: EstimatorSpec


[source]

Generator

polyaxon.models.generators.Generator(mode, encoder_fn, decoder_fn, bridge_fn, loss_config=None, optimizer_config=None, summaries='all', eval_metrics_config=None, clip_gradients=0.5, clip_embed_gradients=0.1, name='Generator')

Generator base model.

  • Args:

    • mode: str, Specifies if this training, evaluation or prediction. See Modes. Possible values: regressor, classifier, generator.
    • encoder_fn: Encoder Graph function. Follows the signature:
      • Args:
      • mode: Specifies if this training, evaluation or prediction. See Modes.
      • inputs: the feature inputs.
    • decoder_fn: Decoder Graph function. Follows the signature:
      • Args:
      • mode: Specifies if this training, evaluation or prediction. See Modes.
      • inputs: the feature inputs.
    • bridge_fn: The bridge to use. Follows the signature:
      • Args:
      • mode: Specifies if this training, evaluation or prediction. See Modes.
      • inputs: the feature inputs.
      • encoder_fn: the encoder function.
      • decoder_fn the decoder function.
    • loss_config: An instance of LossConfig. Default value mean_squared_error.
    • optimizer_config: An instance of OptimizerConfig. Default value Adadelta.
    • summaries: str or list. The verbosity of the tensorboard visualization. Possible values: all, activations, loss, learning_rate, variables, gradients
    • eval_metrics_config: a list of MetricConfig instances.
    • summaries: str or list. The verbosity of the tensorboard visualization. Possible values: all, activations, loss, learning_rate, variables, gradients
    • clip_gradients: float. Gradients clipping by global norm.
    • clip_embed_gradients: float. Embedding gradients clipping to a specified value.
    • name: str, the name of this model, everything will be encapsulated inside this scope.
  • Returns: EstimatorSpec