Customise Tensorboard with buttons, sliders, personal functions - tensorflow

Is it possible to customise Tensorboard with our own buttons, sliders and colours to create a sort of web application ?
Thanks !

Yes, you are able to do this by creating a Tensorboard plugin. This blog post can give you a good idea of what capabilities you can add via a plugin. You can follow this tutorial to get started.
Broadly speaking, the 3 parts of a Tensorboard plugin are:
A summary op that gathers the data you need from the Tensorflow session.
A post-processing python script that serves that data to the web client.
Front-end code to display and interact with the data.
As it sounds like your interests are mostly just pertaining to the presentation, it is likely that you can use data already already gathered by Tensorflow and steps 1 & 2 may be very small or non-existent for your case.

The documentation for Tensorboard plugins has moved to here.

Related

What is needed for a recommendation engine based on word/text input

I'm new to the Machine-Learning (AI) technology. I'm developing a messenger app for Android/IOs where I would like to recommend the users based on the texts/word/conversation a product from a relative small product portfolio.
Example 1:
In case the user of the messenger writes a sentence including the words "vine", "dinner", "date" the AI should recommend a bottle of vine to the user.
Example 2:
In case the user of the app writes that he has drunk a good coffee this morning, the AI should recommend a mug to the user.
Example 3:
In case the user writes something about a cute boy she met last day, the AI should recommend a "teddy bear" to the user.
I'm a Software Developer since almost 20 year with experience in the development of C/C++/Java based application (Android and IOs apps) as well as some experience in Google Cloud Platform. The ML/AI technology is completely new to me. Okay, I know the basics (input data is needed to train the ML/AI system etc.), but I wonder If there is already a framework which could help me to develop such a system which solves the above described uses-case.
I would appreciate it, if you could give me some hints where and how to start.
Thank you and regards
It is definitely possible to implement such an application, in case you want to do it in Google Cloud you will need some understanding of Tensorflow.
First of all, I recommend to you to do the Machine Learning Crash Course, for a good introduction to Machine Learning and to start to familiarize yourself with TensorFlow. Afterwards I recommend to take a look into Tensorflow tutorials which will give you a more practical introduction to Tensorflow, and include various examples on building/training/testing models.
Once you are famirialized with Tensorflow, you can jump into learning how to run jobs in the Machine Learning engine, you can start by following the quickstart. The documentation includes detailed guides on how to use the ml-engine, plus multiple samples and tutorials.
Since I believe that your application would fall into the Recommender System type, here you can see an example model, in Google Cloud ML Engine, on how to recommend items to users based on his previous searches. In your case, you would have to build a model in order to recommend items to users based on his previous words in the sentence.
The second option, in case you don't want to go through the hassle of building a new model from scratch, would be to use the Google Cloud Natural Language API, which you can understand as pre-trained models using Google (incredibly big) data. In your case, I believe that the Content Classifying API would help you achieve what your application intends to do, however, the outputs (which you can see here) are limited to what the model was trained to do, and might not be specific enough for your application, however it is an easy solution and you can still profit of this API in order to extract labels/information and send it as input to another model.
I hope that these links provide you with some foundations on what is possible to do with Tensorflow in the ML Engine, and are useful to you.

How to programatically add/remove nodes from main graph in Tensorboard?

Tensorboard seems to arbitrarily select which nodes belong to the main graph and which do not. During graph visualization I can manually add/remove the nodes but it is tedious to do it every run.
Is there a way to programmatically embed this information (which nodes belong on the main graph) during writing the graph summary?
According to this github issue , it's not feasible at the moment.
And according to this quote :
Thanks #lightcatcher for the suggestion. #danmane, please take a look
at this issue. If it is something we will not do in the short-term
maybe mark it contributions welcome. If it is something you are
planning to include in your plugin API anyways, please close the issue
to keep the backlog clear.
, and the status of the issue (contributions:welcomed), it's not something that is to be expected in the short term.

What Tensorflow API to use for Seq2Seq

This year Google produced 5 different packages for seq2seq:
seq2seq (claimed to be general purpose but
inactive)
nmt (active but supposed to be just
about NMT probably)
legacy_seq2seq
(clearly legacy)
contrib/seq2seq
(not complete probably)
tensor2tensor (similar purpose, also
active development)
Which package is actually worth to use for the implementation? It seems they are all different approaches but none of them stable enough.
I've had too a headache about some issue, which framework to choose? I want to implement OCR using Encoder-Decoder with attention. I've been trying to implement it using legacy_seq2seq (it was main library that time), but it was hard to understand all that process, for sure it should not be used any more.
https://github.com/google/seq2seq: for me it looks like trying to making a command line training script with not writing own code. If you want to learn Translation model, this should work but in other case it may not (like for my OCR), because there is not enough of documentation and too little number of users
https://github.com/tensorflow/tensor2tensor: this is very similar to above implementation but it is maintained and you can add more of own code for ex. reading own dataset. The basic usage is again Translation. But it also enable such task like Image Caption, which is nice. So if you want to try ready to use library and your problem is txt->txt or image->txt then you could try this. It should also work for OCR. I'm just not sure it there is enough documentation for each case (like using CNN at feature extractor)
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/seq2seq: apart from above, this is just pure library, which can be useful when you want to create a seq2seq by yourself using TF. It have a function to add Attention, Sequence Loss etc. In my case I chose that option as then I have much more freedom of choosing the each step of framework. I can choose CNN architecture, RNN cell type, Bi or Uni RNN, type of decoder etc. But then you will need to spend some time to get familiar with all the idea behind it.
https://github.com/tensorflow/nmt : another translation framework, based on tf.contrib.seq2seq library
From my perspective you have two option:
If you want to check the idea very fast and be sure that you are using very efficient code, use tensor2tensor library. It should help you to get early results or even very good final model.
If you want to make a research, not being sure how exactly the pipeline should look like or want to learn about idea of seq2seq, use library from tf.contrib.seq2seq.

Remove image outputs from TensorBoard

My TensorBoard log files grow huge because – it seems – every image summary ever generated is stored. This even though in TensorBoard, it seems like I can only look at the most recent image. And I only need the most recent image anyway.
Is there a way to let TensorBoard know that I only need the latest iamge? I looked at the SummaryWriter API docs but there is no obvious flag.
Hi I work on TensorBoard. To the best of my knowledge, the logs are append only. However when TensorBoard loads them into memory, it uses reservoir sampling so they don't consume all your memory. In the future, we may be implementing a system that will reservoir sampling during the writing phase, or possibly, a tool for compressing logs so they only contain what TensorBoard needs.
While TensorBoard image dashboard only shows the most recent image at the moment, we'd be hesitant to write tools to remove the previous ones, since we may be extending the dashboard to show more than the most recent sample.

Data Visualization: Plotting friendship relations

I guess those who have worked in communities and social networks might have some experience in this.
I am trying to plot a graph of all the friendships that exists on my site and in doing so identify clusters of strongly interconnected users.
Does anyone have any experience in doing something like this? Also, does SQL Server 2008 BI have tools that allows for this type of modelling?
Thanks
Programming Collective Intelligence's chapter 5 is dedicated to optimization and network visualization. Using the modules available here and the snippet below, I could make the following image:
>>> import optimization
>>> import socialnetwork
>>> sol = optimization.annealingoptimize(socialnetwork.domain, socialnetwork.crosscount, step=50, cool=0.99)
>>> socialnetwork.drawnetwork(sol)
The advantages of this approach is that you can easily change the cost function, use different optimization algorithms, or use another library to view the solution.
Take a look at neato from the Graphviz command line tool suite. AS input it takes a so called .dot file. The format is straight forward you should just be able to iterate over all friendship relations in your system and write them into the file.
For inspiration, take a look at these social graphs from "Visual Complexity" collection.
Many visualizations have explanatory papers and articles mentioning graphing tools, libraries and algorithms used to obtain the images.
Examples from "Social Networks" category:
Your graph will be probably reasonably large, so GraphViz is a poor choice. It does a nice job for tiny graphs, but not for huge ones. I'd recommend that you try aiSee instead (here are some example graphs). It requires graphs to be specified in a simple human-readable format called GDL.
(source: aisee.com)
Sample social network http://www.aisee.com/graph_of_the_month/pubmed5.gif
(source: aisee.com)
For visualization, have a look at the Javascript Infovis Toolkit.
You might take a look at the Girvan-Newman algorithm, the output of which gives you an idea of community structure in the form of a dendrogram.
You should look at Mark Shepherd's SpringGraph which is a neat and sexy way of showing big graphs.
Please take a look at the prefuse visualization toolkit
Check out Wikipedia -- Social Network which does talk about social network analysis and graphing relations between users. I think the basic idea is you use a graph to map all the relations and then the more shared relations there are, the higher the interconnected relationships.