Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 477 Bytes

teaching.md

File metadata and controls

18 lines (14 loc) · 477 Bytes

Test teaching page

class MyDenseLayer(tf.keras.layers.Layer):
  def __init__(self, num_outputs):
    super(MyDenseLayer, self).__init__()
    self.num_outputs = num_outputs

  def build(self, input_shape):
    self.kernel = self.add_weight("kernel",
                                  shape=[int(input_shape[-1]),
                                         self.num_outputs])

  def call(self, input):
    return tf.matmul(input, self.kernel)

layer = MyDenseLayer(10)