pip install tensorboard
Result of my trial is around 91% accuracy.import numpy as np import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist # 1. Load MNIST data X_train, y_train, X_test, y_test = mnist.load_data(one_hot=True) # 2. Build a NN Model tf.reset_default_graph() net = tflearn.input_data([None, X_train.shape[1]]) # Input Layer net = tflearn.fully_connected(net, 128, activation='ReLU') # Hidden Layer 1 net = tflearn.fully_connected(net, 32, activation='ReLU') # Hidden Layer 2 net = tflearn.fully_connected(net, 10, activation='softmax') # Output Layer net = tflearn.regression(net, optimizer='sgd', learning_rate=0.01, loss='categorical_crossentropy') model = tflearn.DNN(net, tensorboard_verbose=3) # 3. Traning model.fit(X_train, y_train, validation_set=0.1, show_metric=True, batch_size=100, n_epoch=20) # 4. Testing predictions = np.array(model.predict(X_test)).argmax(axis=1) actual = y_test.argmax(axis=1) test_accuracy = np.mean(predictions == actual, axis=0) print("Test accuracy: ", test_accuracy)
You can see the results with accessing to like http://localhost:6006 by browser. GRAPHS tab shows model topology and training information. SCALARS tab shows training status. If you train the model sometimes, you can see multiple results on the tab.tensorboard --logdir='/tmp/tflearn_logs' --port=6006
I couldn’t output a model which I created using tflearn. So, in this time I used tensorflow. I used this article’s sample .pip install tfgraphviz
The result is following. This is not very easy to understand at first look. But, you can understand overview.import numpy as np import tensorflow as tf tf.reset_default_graph() # Creating input and correct result data x_data = np.random.rand(100).astype(np.float32) y_data = x_data * 0.1 + 0.3 # Build network W = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) b = tf.Variable(tf.zeros([1])) y = W * x_data + b loss = tf.reduce_mean(tf.square(y - y_data)) optimizer = tf.train.GradientDescentOptimizer(0.5) train = optimizer.minimize(loss) # Output graph with tfgraphviz tfg.board(tf.get_default_graph())
I hope this article helps you.### Docker Pull docker pull zuqqhi2/ml-python-sandbox:latest docker images #REPOSITORY TAG IMAGE ID CREATED SIZE #zuqqhi2/ml-python-sandbox latest 4402825ff756 2 hours ago 12.9 GB ### Run jupyter without login to container docker run -it -p 8888:8888 -p 6006:6006 zuqqhi2/ml-python-sandbox
Streamlit is a …
I bought M5Stac…
View Comments
For Alex, your comment is saved at JP version article page.
So, let me put your comment and my answer for you here.
****************************************************************
Alex Nordeen
Hi,
I’ve reached out several times but haven’t heard back, which tells me one of three things:
1. You’re interested in giving link back, but haven’t had a chance to get back to me yet.
2. You’re not interested and want me to stop emailing.
3. You’ve fallen and can’t get up – in that case let me know and I’ll call 911.
Can you please reply with 1, 2 or 3? I don’t want to be a bother.
======================Original Message========================
Hi,
Saw your post on http://35.72.122.189/en/visualization-neural-network-training-using-tensorboard, and noticed that you’ve shared http://tflearn.org/.
Just thought that this piece on TENSOR I recently published might be valuable to your readers/followers as well.
https://www.guru99.com/tensorflow-tutorial.html
As a thankyou, I would be glad to share your page with our 31k Facebook/Twitter/Linkedin Followers.
Cheers!
Alex
****************************************************************
Hi Alex,
Thank you for giving messages to me.
And I’m very sorry.
Just I was suffered from spams and I couldn’t find your comment.
Thank you for sharing your site.
I just took a look at but looks very useful!
About for your question, actually my answer is 1.
But now I’m a little worry about my article is a bit old in the area.
If you think my article is still useful for your followers, I’m very happy for your sharing to your followers.
Thank you.