diff --git a/README.md b/README.md index b64bfdc..5380cb9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,15 @@ conda activate pt # 安装 pytorch v1.12版本已经正式支持了用于mac m1芯片gpu加速的mps后端 conda install pytorch::pytorch torchvision torchaudio -c pytorch -y -pip install -r requirements +pip install -r requirements.txt +``` + +## MAC +```shell +# 安装 pytorch v1.12版本已经正式支持了用于mac m1芯片gpu加速的mps后端 +conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia + +pip install -r requirements.txt ``` ## gpt4free diff --git a/linear regression/1x.py b/linear regression/1x.py index 0b1b93a..b85f3e2 100644 --- a/linear regression/1x.py +++ b/linear regression/1x.py @@ -42,7 +42,7 @@ def run(): learning_rate = 0.0001 initial_b = 0.0 initial_w = 0.0 - num_iterations = 100000 + num_iterations = 5000 [b, w] = gradient_descent_runner(points, initial_b, initial_w, learning_rate, num_iterations) print("After gradient descent at b={0},w={1},error={2}".format(b.item(), w.item(), compute_error_for_line_given_points(b, w, points))) diff --git a/linear regression/print1.png b/linear regression/print1.png index c2933e1..1b6dbdd 100644 Binary files a/linear regression/print1.png and b/linear regression/print1.png differ diff --git a/requirements.txt b/requirements.txt index 60e304e..2e61966 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,4 @@ -pytorch::pytorch -torchvision -torchaudio -pandas -matplotlib numpy -pillow \ No newline at end of file +pandas +pillow +matplotlib