Datetime handline in tensorflow - tensorflow

How does one handle datetime preprocessing/serving in tensorflow? The use case is you have a string, and you want to figure out what time it is. There is more information at https://github.com/tensorflow/transform/issues/113, although the issue isn't really a tensorflow transform issue. It works fine at preprocessing time, but tensorflow serving does not include the operation. I would appreciate any help/guidance on this. Thank you!

Related

is it possible to convert tflite to tf model?

I converted the TF model, which was a float, into a Tflite model, which was an integer, so that I could make inferences on the Edge device. Tflite is a lightweight model, and it is simple to deploy. Tflite, on the other hand, has a few functions and input allocations that are different from those of TF. Consequently, I would like to revert to using TF. If there is anyone who has any insight into this matter. Leave your thoughts in the comments.
Thanks.
Because there are some information lost during the conversion (e.g. due to several optimization steps, etc.), there's no defined way to convert this back. In case you want to revert flatbuffer (.tflite) back to the fozen graph (.pb), you can refer to this Converting .tflite to .pb.

Convert torch model (torch.save) into matricial formulas that can be handled with basic Python

Please could you tell me if it is feasible to transform a torch model (torch.save) into algebraic matrices/ equations that can be operated with numpy or basic Python, without the need to install torch and other related libraries (that occupy a lot of space)? In an afirmative case, could you please give me some hints or a link with explanations? Thank you very much.
I'm not aware of any way to do this without a lot of your own work. Basically you'd have to port most of the pytorch library to numpy, which would be a huge project. If space is an issue check if you can save some space by e.g using earlier torch versions or using only the CPU-versions of pytorch.

Different evaluation accuracy when loading BERT from checkpoint

For some reason, I get wildly different loss and acc when I evaluate my BERT test set right after training vs. when I load from a saved checkpoint. I thought it might have been my adaptation of BERT, so I tried modifying the run_classifier.py script as little as possible to fit my use case, and I still am seeing this problem.
The only reason I can think of is that the model isn't loading correctly, but I don't know how to fix it. I believe I'm loading how originally intended. For the init_checkpoint parameter, I pass path/to/classifier/model.ckpt-{last_step}. There are three model files (meta, index, data) but there are also the checkpoint, events, and graph files. Do I need to be doing something with those other three files as well? I'm used to using keras, and this pure tensorflow saving/loading process seems unnecessarily convoluted to me.
Thank you in advance for any help/insight regarding BERT or pure tf saving/loading! If you're unfamiliar with BERT, here's the github link: BERT GitHub

Numerically Stable Tensorflow

Tensorflow has been used to compute images but I want to use Tensorflow to compute Biological Models. However, the biological model requires big division and this causes numerical instability. I want to have TensorFlow that supports more numerically stability. Are there any hacks to allow Tensorflow to be more numerically stable? I will follow up with more codes in the near feature but if there are any options please tell me.
Please refer to the below paper on Tensorflow Distributions and see if it helps answer your question.
https://arxiv.org/pdf/1711.10604.pdf
If not, please elaborate your issue.
Mention any code snippet of what you have tried, or any limitations you faced while implementing your model.

How to predict using Tensorflow?

This is a newbie question for the tensorflow experts:
I reading lot of data from power transformer connected to an array of solar panels using arduinos, my question is can I use tensorflow to predict the power generation in future.
I am completely new to tensorflow, if can point me to something similar I can start with that or any github repo which is doing similar predictive modeling.
Edit: Kyle pointed me to the MNIST data, which I believe is a Image Dataset. Again, not sure if tensorflow is the right computation library for this problem or does it only work on Image datasets?
thanks, Rajesh
Surely you can use tensorflow to solve your problem.
TensorFlowâ„¢ is an open source software library for numerical
computation using data flow graphs.
So it works not only on Image dataset but also others. Don't worry about this.
And about prediction, first you need to train a model(such as linear regression) on you dataset, then predict. The tutorial code can be found in tensorflow homepage .
Get your hand dirty, you will find it works on your dataset.
Good luck.
You can absolutely use TensorFlow to predict time series. There are plenty of examples out there, like this one. And this is a really interesting one on using RNN to predict basketball trajectories.
In general, TF is a very flexible platform for solving problems with machine learning. You can create any kind of network you can think of in it, and train that network to act as a model for your process. Depending on what kind of costs you define and how you train it, you can build a network to classify data into categories, predict a time series forward a number of steps, and other cool stuff.
There is, sadly, no short answer for how to do this, but that's just because the possibilities are endless! Have fun!