chemicalchecker.tool.adanet.dnn_stack_generator.StackDNNBuilder
- class StackDNNBuilder(optimizer, layer_size, num_layers, learn_mixture_weights, dropout, seed, activation, input_shape, nan_mask_value=0.0)[source]
Bases:
Builder
Builds a DNN subnetwork for AdaNet.
Initializes a _DNNBuilder.
- Parameters:
optimizer – An Optimizer instance for training both the subnetwork and the mixture weights.
layer_size – The number of nodes to output at each hidden layer.
num_layers – The number of hidden layers.
learn_mixture_weights – Whether to solve a learning problem to find best mixture weights, or use their default value according to the mixture weight type. When False, the subnetworks will return a no_op for the mixture weight train op.
dropout – The dropout rate, between 0 and 1. E.g. “rate=0.1” would drop out 10% of input units.
activation – The activation function to be used.
seed – A random seed.
- Returns:
An instance of StackDNNBuilder.
Methods
See adanet.subnetwork.Builder.
See adanet.subnetwork.Builder.
Returns a subnetwork.Report to materialize and record.
See adanet.subnetwork.Builder.
Attributes
See adanet.subnetwork.Builder.
- build_mixture_weights_train_op(loss, var_list, logits, labels, iteration_step, summary)[source]
See adanet.subnetwork.Builder.
- build_subnetwork(features, logits_dimension, training, iteration_step, summary, previous_ensemble=None)[source]
See adanet.subnetwork.Builder.
- build_subnetwork_report()
Returns a subnetwork.Report to materialize and record.
This method will be called once after
build_subnetwork()
. Do NOT depend on variables created inbuild_subnetwork_train_op()
, because they are not called beforebuild_subnetwork_report()
is called.If it returns None, AdaNet records the name and standard eval metrics.
- build_subnetwork_train_op(subnetwork, loss, var_list, labels, iteration_step, summary, previous_ensemble)[source]
See adanet.subnetwork.Builder.
- property name
See adanet.subnetwork.Builder.