conda shit is weird, and don't understand how tf works still

This commit is contained in:
2018-11-17 05:12:48 +01:00
parent 95246f5da7
commit f870fb8f9f
4 changed files with 80 additions and 0 deletions

31
AI/mk1/main.py Normal file
View File

@@ -0,0 +1,31 @@
import numpy as np
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import LSTM
from keras.utils import np_utils
text=(open("temp.txt"))
text = " ".join(text).lower()
characters = sorted(list(set(text)))
print(characters)
n_to_char = {n:char for n, char in enumerate(characters)}
char_to_n = {char:n for n, char in enumerate(characters)}
x = []
y = []
length = len(text)
seq_length = 100 #batch size?
for i in range(0,length-seq_length, 1):
sequence = text[i:i+seq_length]
label = text[i+seq_length]
x.append([char_to_n[char] for char in sequence])
y.append(char_to_n[label])