Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensorflow as tf
- from tensorflow import keras
- import os
- import numpy as np
- class Linear_regressor(keras.layers.Layer):
- def __init__(self):
- super(Linear_regressor, self).__init__()
- self.w = self.add_variable('weights', [13, 1])
- self.b = self.add_variable('bias', [1])
- def call(self, x):
- linear = tf.matmul(x, self.w) + self.b
- return linear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement