Simulate/emulate Google TPU for development and debug - tpu

Is there an emulator to debug code for TPU, instead of expending money debugging on real TPU before everything is ready to work?
Any other technique that would have a similar effect would be appreciated as answer as well.

I've found out that there's not an emulator nor any kind of virtualization of TPUs for development.
What can be done instead, is to run your code in Colab notebooks, being restricted by some limitations (i.e. your data has to be stored in Google Cloud to be accessible for the notebook).
There are several articles in websites like Medium about training/using models in TPUs through notebooks, each one focusing on different aspects or with different content within the example code. Here is one of them, just to provide an example and further useful links for anyone interested.

Related

How to use Natural Language Processing (AI) in app lab?

I know about NLP being used in js but now , I am asked to do it in app lab.
I tried a lot of research but found no way to do it in blocks, app lab in code.org.
It should understand various diseases.
I would be grateful for any help.
While NLP isn't entirely supported natively in App Lab, you can try using the getPrediction() block. Its documentation is listed here.

Can You Mesh Network Google Coral TPUs

I believe it is possible to leverage the power of two USB Connected connected Google Coral TPUs in conjunction with one another (or at least side by side, running their own inferences each).
However, is it possible to leverage two or more Google Coral TPUs which are connected to separate Edge Devices but which sit on the same network connected by hard line ethernets & a switch?
Humn, there is no official API for doing this. So I guess I'll give you a more general answer.
You may want to look into kubenetes? I have not tried it, but it seems that they have supports for aarch64 which should works perfectly on the dev board.
Create servers and communicate via http? I actually have an opensource project calls restor, unfortunately it hasn't been maintained. But you may also check out doods.
Possibilities are endless :)
You may run multiple models on a TPU or also you may run multiple TPUs on a single device. Look into this:
https://coral.ai/docs/edgetpu/multiple-edgetpu/
If you would run multiple models on a TPU, the TPU will probably keep switching between models to load them. But, you may combine them using the compiler tool to avoid this.
If you would use multiple TPU devices on a single device, you may tell the interpreter instance which device you mean.
All the information are in the above link.

Any pytorch tools to monitor neural network's training?

Are there any tools to monitor network's training in PyTorch? Like tensorboard in tensorflow.
PyTorch 1.1.0 supports TensorBoard natively with torch.utils.tensorboard. The API is very similar to tensorboardX. See the documentation for more details.
I am using tensorboardX. It supports most (if not all) of the features of TensorBoard. I am using the Scalar, Images, Distributions, Histograms and Text. I haven't tried the rest, like audio and graph, but the repo also contains examples for those use cases. The installation can be done easily with pip. It's all explained in the README file of the repo.
There are also other github repos which implement a wrapper for PyTorch (and other languages/frameworks) to tensorboard. As far as I know they support fewer functionalities. But have a look at:
Crayon
Tensorboard-Logger
I have asked this question before in the forums. Tensorboard seems very convenient for Tensorflow and it is also made part of the library/framework itself. However, PyTorch wouldn't take the same approach. But there is a library called visdom here that is released by Facebook, that helps you log the training information. This gives you the flexibility of logging information the way you want. While this means a lot of flexibility, it also means you need to write some extra code to make things work.
Following up on blckbird's answer, I'm also a big fan of Tensorboard-PyTorch. However I also found that its API is relatively low level and I was writing a lot of similar code over and over to do the logging. So (shameless plug) I've written a small package on top of it to automate monitoring network training experiments with minimal code. Hopefully someone else finds it helpful. pytorch-monitor
Minetorch helps me a lot at the past 2 Kaggle competitions. I think it's ready for others to use. It has built-in tensorboard or matplotlib supported. And many other features which make the work easy, includes:
Logger
Tensorboard supported
Matplotlib (to generate png to file)
Auto resume training
Auto best model saving
Hook points for customize
...
It's still in developing so any issues or PRs are very welcomed : )

How can I turn off all TCP traffic in VS Code?

I've followed Microsoft's directions to disable updates, telemetry and crash reporting, but VS Code is still talking to the web. It looks like there's something going on in editorSimpleWorker.js and editorWorkerServer.js, but those are some pretty big haystacks to start combing.
Does anyone know what VS Code is trying to accomplish by talking to the web? Marketplace? npm? And how to disable it? I can block the outgoing TCP traffic, of course, but besides that?
As of now, two weeks after posting the question, I am pretty confident in making the following statement:
There is no documented configuration option or combination of options that will turn off all web traffic conducted by Visual Studio Code.
At least some of the traffic that I've observed is related to the extensions gallery.
Ultimately, VS Code was built to be online. It is intended to talk to the web. If you are trying to use it in an environment in which such connectedness is discouraged, you will have difficulties of some type or other. Instead, find a different product that better fits your requirements, whatever they may be.

building an app to cater for WP7,Iphone & Android

I am about to start building an app that will be used across all platforms. I will using monotouch and monodriod so I can keep things in .net
I'm a little lazy so I want to be able to reuse as much code as possible.
Lets say I want to create an application that stores contact information. e.g. Name & Phone number
My application needs to be able to retrieve data from a web service and also store data locally.
The MVVM pattern looks like the way to go but im not sure my approach below is 100% correct
Is this correct?
A project that contains my models
A project that contains my views,local storage methods and also view models which I bind my views to. In this case there would be 3 different projects based on the 3 os's
A data access layer project that is used for binding to services and local data storage
Any suggestions would be great.
Thanks for your time
Not specifically answering your question, but here are some lazy pointers...
you can definitely reuse a lot of code across all 3 platforms (plus MonoWebOS?!)
reusing the code is pretty easy, but you'll need to maintain separate project files for every library on each platform (this can be a chore)
MVVM certainly works for WP7. It's not quite as well catered for in MonoTouch and MonoDroid
some of the main areas you'll need to code separately for each device are:
UI abstractions - each platform has their own idea of "tabs", "lists", "toasts", etc
network operations - the System.Net capabilities are slightly different on each
file IO
multitasking capabilities
device interaction (e.g. location, making calls etc)
interface abstraction and IoC (Ninject?) could help with all of these
The same unit tests should be able to run all 3 platforms?
Update - I can't believe I just stumbled across my own answer... :) In addition to this answer, you might want to look at MonoCross and MvvmCross - and no doubt plenty of other hybrid platforms on the way:
https://github.com/slodge/MvvmCross
http://monocross.net (MVC Rather then Mvvm)
Jonas Follesoe's cross platform development talk: Has to be the most comprehensive resource out there at the moment. He talks about how best to share code and resources, abstract out much of the UI and UX differences, shows viable reusable usage of MVVM across platforms and nice techniques for putting together an almost automated build. (yes, that includes a way for you to compile you monotouch stuff on Visual Studio)
Best of all he has a available source code for the finished product and for a number of the major component individually placed in its own workshop project and a 50 + page pdf detailing the steps to do so.FlightsNorway on github
IMO the only thing missing is how best to handle local data storage across all platforms. In which case I would direct you to Vici Cool Storage an ORM that can work with WP7, MonoTouch and (while not officially supported) MonoDroid.
*Disclaimer* The site documentation isn't the most updated but the source code is available. (Because documentation is Kriptonite to many a programmer)
I think the easiest way to write the code once and have it work on all three platforms will probably be a web-based application. Check out Untappd for example.
You can start by looking at Robert Kozak's MonoTouch MVVM framework. It's just a start though.
MonoTouch MVVM