Sunday, September 29, 2019
Wednesday, September 25, 2019
Keras Squential Model
# example of training a final classification model
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
import numpy as np
X=np.array([[0,0],[0,1],[1,0],[1,1]])
T=np.array([[0],[1],[1],[0]])
# define and fit the final model
model = Sequential()
model.add(Dense(1000, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam')
model.fit(X, T, epochs=2000)
model.save_weights("model.h5")
history =model.history
plt.plot(history.history['loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()
Xp=np.array([[1,1]])
model.predict(Xp)
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense
import numpy as np
X=np.array([[0,0],[0,1],[1,0],[1,1]])
T=np.array([[0],[1],[1],[0]])
# define and fit the final model
model = Sequential()
model.add(Dense(1000, input_dim=2, activation='relu'))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam')
model.fit(X, T, epochs=2000)
model.save_weights("model.h5")
history =model.history
plt.plot(history.history['loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()
Xp=np.array([[1,1]])
model.predict(Xp)
Tuesday, September 03, 2019
Sunday, September 01, 2019
Tugas Pemprosesan Citra dan Video
Daftar tugas Pemprosesan Citra dan Video
- Deteksi Jalur Jalan
- Game Main bola
- Segmentasi Citra Berbasis Textur
- Deteksi Rambu lalu Lintas
- Deteksi Gerakan
- Deteksi Mobil Parkir
- Deteksi Jenis Uang
- Line Detection
- Deteksi Buah Apel Matang
- Deteksi Warna lampu lalu lintas
Subscribe to:
Posts (Atom)