Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import tensorflow as tf
  2. from tensorflow import keras
  3.  
  4. import os
  5. import numpy as np
  6.  
  7. class Linear_regressor(keras.layers.Layer):
  8.  
  9. def __init__(self):
  10. super(Linear_regressor, self).__init__()
  11.  
  12. self.w = self.add_variable('weights', [13, 1])
  13. self.b = self.add_variable('bias', [1])
  14.  
  15. def call(self, x):
  16. linear = tf.matmul(x, self.w) + self.b
  17. return linear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement