Created
May 23, 2020 03:43
-
-
Save cedricconol/f70f015172fad78903dddb790cdea272 to your computer and use it in GitHub Desktop.
Linear regression TF2 train
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def train(self, X, y, learning_rate=0.01, epochs=5): | |
if len(X.shape)==1: | |
X=tf.reshape(X,[X.shape[0],1]) | |
self.m.assign([self.var]*X.shape[-1]) | |
for i in range(epochs): | |
print("Epoch: ", i) | |
self.update(X, y, learning_rate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment