SyntaxError: keyword can't be an expression
526
ybs11643788
1 câu hỏi đã được viết
0
x_data = tf.random.normal(shape=(1000,), dtype=tf.float32)
y_data = 3*x_data - 1
w = tf.Variable(-1.)
b = tf.Variable(-1.)
learning_rate = 0.01
w_trace, b_trace = [], []
for x, y in zip(x_data, y_data):
with tf.GradientTape() as tape:
prediction = w*x + b
loss = (prediction - y)**2
gradients = tape.gradient(loss, [w, b])
w_trace.append(w.numpy())
b_trace.append(b.numpy())
w = tf.Variable(w - learning_rate=gradients[0])
b = tf.Variable(b - learning_rate=gradients[1])
flg, ax = plt.subplots(figsize=(20, 10))
ax.plot(w_trace,
label='weight')
ax.plot(b_trace,
label='bias')
ax.tick_params(labelsize=20)
ax.legend(fontsize=30)
File "<ipython-input-20-19f2193f023b>", line 19 w = tf.Variable(w - learning_rate=gradients[0]) ^ SyntaxError: keyword can't be an expression
구글 코랩으로 진행하고 있다가 이런 오류가 났습니다, 어떻게 해결해야 하나요?
tensorflow
딥러닝
Câu trả lời 0
<div id="banner">배너 이미지</div> 관련 질문
0
35
1
수업자료
0
56
2
paperswithcode 서비스 종료 관련 문의
0
322
2
22강 코드 call()메서드 is_training -> model(x,False)로 호출시 밸류에러 참고
0
76
1
강의자료 질문
0
70
1
강의자료는 어떻게 보나요
0
125
2
resize 질문
0
72
1
Colab실습관련
0
105
2
트랜스포머 FeedForward 관련 질문
0
128
2
mmdetection 2.x과 3.x 호환 관련 표기
0
105
2
mm_faster_rcnn_train_kitti.ipynb 실행 오류
0
134
3
[해결]그랩님 답변 주세요.
0
214
2
20251212 Kaggle 런타임에 scikit-learn 설치 실패 트러블 슈팅
0
90
1
get_dummies 관련문의
0
95
2
강의 수강
0
107
1
질문 드립니다.
0
108
3
동영상 재생오류
0
70
1
multiple inputs
0
328
1
epoch 1부터 loss가 너무 낮게 나와 학습이 안되네요
0
561
1
텍스트 데이터일 때의 dtype
0
284
1
12강 data split take와 skip
0
333
1
<tensorflow사용메뉴얼> 강의파일
0
304
0
강의 감사합니다. 다섯번째 강의인 Model Implementation가 재생이 안됩니다.
0
182
0
unsupported operand type(s) for *: 'float' and 'NoneType'
0
1982
1

