(self, points)
return out
Build the evaluation graph.
Build the evaluation graph.
Build the evaluation graph .
def build_evaluation(self, points):
        """Build the evaluation graph."""
        net = points
        if isinstance(net, np.ndarray):
            net = tf.constant(net)

        initializer = tf.contrib.layers.xavier_initializer()

        for i, (layer, activation) in enumerate(zip(self.layers[:-1],
                                                    self.nonlinearities[:-1])):
            net = tf.layers.dense(net,
                                  units=layer,
                                  activation=activation,
                                  use_bias=self.use_bias,
                                  kernel_initializer=initializer,
                                  name='layer_{}'.format(i))

        # Output layer
        net = tf.layers.dense(net,
                              units=self.layers[-1],
                              activation=self.nonlinearities[-1],
                              use_bias=False,
                              kernel_initializer=initializer,
                              name='output')

        # Scale output range
        out = tf.multiply(net, self.output_scale, name='output_scale')
        return out
def build_evaluation ( self , points ) : net = points if isinstance ( net , np . ndarray ) : net = tf . constant ( net ) initializer = tf . contrib . layers . xavier_initializer ( ) for i , ( layer , activation ) in enumerate ( zip ( self . layers [ : - 1 ] , self . nonlinearities [ : - 1 ] ) ) : net = tf . layers . dense ( net , units = layer , activation = activation , use_bias = self . use_bias , kernel_initializer = initializer , name = 'layer_{}' . format ( i ) ) # Output layer net = tf . layers . dense ( net , units = self . layers [ - 1 ] , activation = self . nonlinearities [ - 1 ] , use_bias = False , kernel_initializer = initializer , name = 'output' ) # Scale output range out = tf . multiply ( net , self . output_scale , name = 'output_scale' ) return out