Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
- y = np.array([[0], [1], [1], [0]])
- model = Sequential([
- Dense(2, activation="sigmoid", input_dim=2),
- Dense(1, activation="sigmoid")
- ])
- model_1.compile(loss="binary_crossentropy", optimizer="adamax")
- model_1.fit(X, y, batch_size=4, epochs=16000)
- model_2.compile(loss="binary_crossentropy", optimizer="sgd") # Never converge independently of how many epochs
- model_2.fit(X, y, batch_size=4, epochs=16000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement