1 Star 0 Fork 11

机器学习炼成记/TensorFlow-Course

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

Linear Regression

This document is dedicated to explain how to run the python script for this tutorial. The documentation is available here. Alternatively, you can check this Linear Regression using TensorFlow blog post for further details.

Python Environment

WARNING: If TensorFlow is installed in any environment(virtual environment, ...), it must be activated at first. So at first make sure the tensorFlow is available in the current environment using the following script:

How to run the code in Terminal?

Please root to the code/ directory and run the python script as the general form of below:

python [python_code_file.py]

As an example the code can be executed as follows:

python linear_regression.py --num_epochs=50

The --num_epochs flag is to provide the number of epochs that will be used for training. The --num_epochs flag is not required because its default value is 50 and is provided in the source code as follows:

tf.app.flags.DEFINE_integer(
'num_epochs', 50, 'The number of epochs for training the model. Default=50')

How to run the code in IDEs?

Since the code is ready-to-go, as long as the TensorFlow can be called in the IDE editor(Pycharm, Spyder,..), the code can be executed successfully.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wangke0825/TensorFlow-Course.git
git@gitee.com:wangke0825/TensorFlow-Course.git
wangke0825
TensorFlow-Course
TensorFlow-Course
master

Search