laptop commit linear regression

This commit is contained in:
Bartosz Ogonowski 2020-05-02 22:10:18 +02:00
parent 7463017086
commit 25288337b6
3 changed files with 2075 additions and 2075 deletions

View File

@ -53,8 +53,8 @@ def read_words(input_path):
return vocabulary
def train(vocabulary,input_train,expected_train):
learning_rate=0.000001
#learning_precision=0.0000001
learning_rate=0.00001
#learning_precision=0.000001
words_vocabulary={}
with open(input_train,encoding='utf-8') as input_file, open(expected_train,encoding='utf-8') as expected_file:
for line, exp in zip(input_file,expected_file):
@ -65,7 +65,7 @@ def train(vocabulary,input_train,expected_train):
iteration=0
loss_sum=0.0
error=10.0
max_iteration=len(vocabulary) + 5000
max_iteration=10000
for i in vocabulary['count'].keys():
weights[i]=random.uniform(-0.01,0.01)
# delta>learning_precision and

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff