I've recently reviewed an interesting implementation for convolutional text classification. However all TensorFlow code I've reviewed uses a random (not pre-trained) embedding... moreI've recently reviewed an interesting implementation for convolutional text classification. However all TensorFlow code I've reviewed uses a random (not pre-trained) embedding vectors like the following:
with tf.device('/cpu:0'), tf.name_scope("embedding"):
W = tf.Variable(
tf.random_uniform(, -1.0, 1.0),
name="W")
self.embedded_chars = tf.nn.embedding_lookup(W, self.input_x)
self.embedded_chars_expanded = tf.expand_dims(self.embedded_chars, -1)
Does anybody know how to use the results of Word2vec or a GloVe pre-trained word embedding instead of a random one?
And when I check my GPU memory usage, around 90% of it gets... moreCreating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN Black, pci bus id: 0000:01:00.0)
And when I check my GPU memory usage, around 90% of it gets consumed.
Tensorflow documentation does not say anything about this. Does it take control of the gpu ? Why does it consume most of the memory ?
There's various activation functions: sigmoid, tanh, etc. And there's also a few initializer functions: Nguyen and Widrow, random, normalized, constant, zero, etc. So do these... moreThere's various activation functions: sigmoid, tanh, etc. And there's also a few initializer functions: Nguyen and Widrow, random, normalized, constant, zero, etc. So do these have much effect on the outcome of a neural network specialising in face detection? Right now I'm using the Tanh activation function and just randomising all the weights from -0.5 to 0.5. I have no idea if this is the best approach though, and with 4 hours to train the network each time, I'd rather ask on here than experiment!
I have been using the introductory example of matrix multiplication in TensorFlow.matrix1 = tf.constant()matrix2 = tf.constant(,)product = tf.matmul(matrix1, matrix2)When I print... moreI have been using the introductory example of matrix multiplication in TensorFlow.matrix1 = tf.constant()matrix2 = tf.constant(,)product = tf.matmul(matrix1, matrix2)When I print the product, it is displaying it as a Tensor object:But how do I know the value of product?The following doesn't help:print productTensor("MatMul:0", shape=TensorShape(), dtype=float32)I know that graphs run on Sessions, but isn't there any way I can check the output of a Tensorobject without running the graph in a session?
I'm new into the ML Scene and I want to create a phonegap app involving Tensorflow but I'm unsure where to start or if this is even possible. Can anyone give me a hand (Probably... moreI'm new into the ML Scene and I want to create a phonegap app involving Tensorflow but I'm unsure where to start or if this is even possible. Can anyone give me a hand (Probably by linking me to some resources)? My app will just use tensor flow image recognition (probably pre-trained).
Thanks, Felix. (This is a repost of this same question in the data science category which failed to garner a response)
I trained quora question pair detection with LSTM but training accuracy is very low and always changes when i train. I dont understand what mistake i did.
I tried changing loss... moreI trained quora question pair detection with LSTM but training accuracy is very low and always changes when i train. I dont understand what mistake i did.
I tried changing loss and optimiser and with increased epoch.
import numpy as np
from numpy import array
from keras.callbacks import ModelCheckpoint
import keras
from keras.optimizers import SGD
import tensorflow as tf
from sklearn import preprocessing
import xgboost as xgb
from keras import backend as K
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from keras.preprocessing.text import Tokenizer , text_to_word_sequence
from keras.preprocessing.sequence import pad_sequences
from keras.layers.embeddings import Embedding
from keras.models import Sequential, model_from_json, load_model
from keras.layers import LSTM, Dense, Input, concatenate, Concatenate, Activation, Flatten
from keras.models import Model
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from... less
I have installed Python version 3.5 and 3.6 and anaconda.
The following error occures when trying to install tensorflow following the steps... moreI have installed Python version 3.5 and 3.6 and anaconda.
The following error occures when trying to install tensorflow following the steps here https://www.tensorflow.org/install/install_windows unsing anaconda
(tensorflow) C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
tensorflow-1.0.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
As I am new to Python, I do not know how to circumvent this probelm. I am using Win10 with 64bit.
Thanks a lot and best,
Martin less
I would like to know How to apply gradient clipping on this network on the RNN where there is a possibility of exploding gradients.
tf.clip_by_value(t, clip_value_min,... moreI would like to know How to apply gradient clipping on this network on the RNN where there is a possibility of exploding gradients.
tf.clip_by_value(t, clip_value_min, clip_value_max, name=None)
This is an example that could be used but where do I introduce this ? In the def of RNN
lstm_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)
# Split data because rnn cell needs a list of inputs for the RNN inner loop
_X = tf.split(0, n_steps, _X) # n_steps
tf.clip_by_value(_X, -1, 1, name=None)
But this doesn't make sense as the tensor _X is the input and not the grad what is to be clipped?
Do I have to define my own Optimizer for this or is there a simpler option? less
When I start training a model, there is no model saved previously. I can use model.compile() safely. I have now saved the model in a h5 file for further training... moreWhen I start training a model, there is no model saved previously. I can use model.compile() safely. I have now saved the model in a h5 file for further training using checkpoint.
Say, I want to train the model further. I am confused at this point: can I use model.compile() here? And should it be placed before or after the model = load_model() statement? If model.compile() reinitializes all the weights and biases, I should place it before model = load_model() statement.
After discovering some discussions, it seems to me that model.compile() is only needed when I have no model saved previously. Once I have saved the model, there is no need to use model.compile(). Is it true or false? And when I want to predict using the trained model, should I use model.compile() before predicting? less
I have installed the Tensorflow bindings with python successfully. But when I try to import Tensorflow, I get the follwoing error.
ImportError: /lib/x86_64-linux-gnu/libc.so.6:... moreI have installed the Tensorflow bindings with python successfully. But when I try to import Tensorflow, I get the follwoing error.
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow.so)
I have tried to update GLIBC_2.15 to 2.17, but no luck.
am using TensorFlow to train a neural network. This is how I am initializing the GradientDescentOptimizer:
init = tf.initialize_all_variables()
sess = tf.Session()... moream using TensorFlow to train a neural network. This is how I am initializing the GradientDescentOptimizer:
init = tf.initialize_all_variables()
sess = tf.Session()
sess.run(init)
mse = tf.reduce_mean(tf.square(out - out_))
train_step = tf.train.GradientDescentOptimizer(0.3).minimize(mse)
The thing here is that I don't know how to set an update rule for the learning rate or a decay value for that.
How can I use an adaptive learning rate here?
I installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules in PyCharm (Numpy, Pandas, etc), but... moreI installed the latest version of Python (3.6.4 64-bit) and the latest version of PyCharm (2017.3.3 64-bit). Then I installed some modules in PyCharm (Numpy, Pandas, etc), but when I tried installing Tensorflow it didn't install, and I got the error message:Could not find a version that satisfies the requirement TensorFlow (from versions: ) No matching distribution found for TensorFlow.Then I tried installing TensorFlow from the command prompt and I got the same error message. I did however successfully install tflearn.I also installed Python 2.7, but I got the same error message again. I googled the error and tried some of the things which were suggested to other people, but nothing worked (this included installing Flask).How can I install Tensorflow? Thanks. less
Classification problems, such as logistic regression or multinomial logistic regression, optimize a cross-entropy loss. Normally, the cross-entropy layer follows the softmax... moreClassification problems, such as logistic regression or multinomial logistic regression, optimize a cross-entropy loss. Normally, the cross-entropy layer follows the softmax layer, which produces probability distribution.In tensorflow, there are at least a dozen of different cross-entropy loss functions:tf.losses.softmax_cross_entropytf.losses.sparse_softmax_cross_entropytf.losses.sigmoid_cross_entropytf.contrib.losses.softmax_cross_entropytf.contrib.losses.sigmoid_cross_entropytf.nn.softmax_cross_entropy_with_logitstf.nn.sigmoid_cross_entropy_with_logits...Which one works only for binary classification and which are suitable for multi-class problems? When should you use sigmoid instead of softmax? How are sparse functions different from others and why is it only softmax? less
I am trying to do some deep learning work. For this, I first installed all the packages for deep learning in my Python environment.Here is what I did.In Anaconda, I created an... moreI am trying to do some deep learning work. For this, I first installed all the packages for deep learning in my Python environment.Here is what I did.In Anaconda, I created an environment called tensorflow as follows
conda create -n tensorflow
Then installed the data science Python packages, like Pandas, NumPy, etc., inside it. I also installed TensorFlow and Keras there. Here is the list of packages in that environment
(tensorflow) SFOM00618927A:dl i854319$ conda list
# packages in environment at /Users/i854319/anaconda/envs/tensorflow:
#
appdirs 1.4.3 <pip>
appnope 0.1.0 py36_0
beautifulsoup4 4.5.3 py36_0
bleach 1.5.0 py36_0
cycler 0.10.0 py36_0
decorator 4.0.11 py36_0
entrypoints 0.2.2 py36_1
freetype 2.5.5 ... less
I have created a data science neural network in Python anaconda Spyder. My projects have multiple .py files and I have trained this model for 10 days and weights are generated. I... moreI have created a data science neural network in Python anaconda Spyder. My projects have multiple .py files and I have trained this model for 10 days and weights are generated. I want to use this model as a service and want to deploy it to Azure for consumption. I tried following but facing difficulties -
1) I tried deploying this as "Execute Python Script" in Azure ML studio but I am not finding an option to upload the weights. I understand I can zip all the .py files but what about the trained weights and virtual environment (I am using an old version of tensorflow)?
2) I am seeing an option of creating a Jupyter notebook but my project is created in Spyder and doesn't have .ipynb files. Is there any way to convert my .py files into .ipynb files? ALso, I have created a virtual environment with the older version of tensorflow and python version? How to take care of this while deploying to azure?
3) I tried deploying this to azure as a python web app but again what shall I do with the virtual... less