-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d783be8
commit 6920cbb
Showing
217 changed files
with
38 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Deep Learning Exercises | ||
|
||
This repository includes some deep learning codes for ramp-up, including TensorBasic, TensorCV, TensorNLP, TensorGAN. | ||
This repository includes some deep learning codes for ramp-up. |
74 changes: 37 additions & 37 deletions
74
...asic/LinearRegression/LinearRegression.py → ...asic/LinearRegression/LinearRegression.py
100755 → 100644
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import tensorflow as tf | ||
|
||
x_data = np.random.rand(100).astype(np.float32) | ||
y_data = 3.0 * x_data + 1.0 | ||
print("x_data: ", x_data) | ||
print("y_data: ", y_data) | ||
|
||
# Define trainable variables | ||
W = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) | ||
b = tf.Variable(tf.zeros([1])) | ||
|
||
# Define graph operations | ||
y = tf.multiply(W, x_data) + b | ||
|
||
# Define loss | ||
loss = tf.reduce_mean(tf.square(y - y_data)) | ||
|
||
# Define optimizer for training | ||
train_optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.5).minimize(loss) | ||
|
||
# Define the operation that initializes variables | ||
init = tf.global_variables_initializer() | ||
|
||
# Launch the graph | ||
with tf.Session() as sess: | ||
# Initialization | ||
sess.run(init) | ||
|
||
# Start training | ||
training_iters = 1000 | ||
for step in range(training_iters): | ||
if step % 20 == 0 or (step + 1) == training_iters: | ||
print(step, sess.run(W), sess.run(b)) | ||
|
||
_ = sess.run([train_optimizer]) | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import tensorflow as tf | ||
|
||
x_data = np.random.rand(100).astype(np.float32) | ||
y_data = 3.0 * x_data + 1.0 | ||
print("x_data: ", x_data) | ||
print("y_data: ", y_data) | ||
|
||
# Define trainable variables | ||
W = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) | ||
b = tf.Variable(tf.zeros([1])) | ||
|
||
# Define graph operations | ||
y = tf.multiply(W, x_data) + b | ||
|
||
# Define loss | ||
loss = tf.reduce_mean(tf.square(y - y_data)) | ||
|
||
# Define optimizer for training | ||
train_optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.5).minimize(loss) | ||
|
||
# Define the operation that initializes variables | ||
init = tf.global_variables_initializer() | ||
|
||
# Launch the graph | ||
with tf.Session() as sess: | ||
# Initialization | ||
sess.run(init) | ||
|
||
# Start training | ||
training_iters = 1000 | ||
for step in range(training_iters): | ||
if step % 20 == 0 or (step + 1) == training_iters: | ||
print(step, sess.run(W), sess.run(b)) | ||
|
||
_ = sess.run([train_optimizer]) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.