<jupyter_start><jupyter_text>Lesson 01 Đề bài:Cho phuong trình y=ax+b- Cho nghiệm x=[x1,x2,....,xn], y=[y1,y2,....,yn]- Tìm w (weight)- (b: bias)<jupyter_code>import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1" #Ep training tren CPU
from keras.layers import *
from keras.models import *
from keras import optimizers
x=[1, 2, 3, 4]
y=[2, 4, 6, 8]
x, y
model=Sequential([
    Dense(1, input_shape=(1,))
])
model.summary()
sgd=optimizers.SGD(lr=0.01) #Toc do traning
model.compile(loss='mse',optimizer=sgd)
model.fit(x,y,epochs=700) #Training 700 lan
y_pred=model.predict([11.])
y_pred
y_pred=model.predict([7.])
y_pred<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18633540372670807, 'fraction_numerical': 0.04503105590062112, 'mean_word_length': 6.166666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '186591', 'license': 'MIT', 'n_tokens_mistral': 310, 'n_tokens_neox': 289, 'n_words': 59, 'path': 'lesson01.ipynb', 'repo_name': 'vfaHungnv/DeepLearning', 'size': '644'}