deep-learning

Improve Accuracy for a Siamese Network

£可爱£侵袭症+ 提交于 2020-02-25 02:10:11
问题 I wrote this little model using Keras Functional API to find similarity of a dialogue between two individuals. I am using Gensim's Doc2Vec embeddings for transforming text-data into vectors (vocab size: 4117). My data is equally divided up into 56 positive cases and 64 negative cases. (yes I know the dataset is small - but that's all I have for the time being). def euclidean_distance(vects): x, y = vects sum_square = K.sum(K.square(x - y), axis=1, keepdims=True) return K.sqrt(K.maximum(sum

Remove black header section of image using Python OpenCV

*爱你&永不变心* 提交于 2020-02-22 07:45:08
问题 I need to remove the blackened section in multiple parts of image using Python CV. I tried with denoising which doesn't give satisfactory results. Eg. I need to remove the blackened part in Table Header (below image) and convert the header background to white with contents as black. Can anyone help me with choosing the correct library or solution to overcome this? 回答1: Here's a modified version of @eldesgraciado's approach to filter the dotted pattern using a morphological hit or miss

How to downgrade to cuda 10.0 in arch linux?

孤人 提交于 2020-02-21 11:04:36
问题 I want to downgrade my cuda 10.1 to cuda 10.0 in arch linux as tensorflow requires cuda 10.0 only. I installed tensorflow on CUDA 10.1 in arch Linux but I didn't know tensorflow-gpu needs CUDA 10.0 or lesser. I tried tried symlinking the required 10.0 libraries with new 10.1 libraries but it didn't work. Whenever I try to import tensorflow in python console error shows up that 'libcublas.so.10.0' not found. So I found out that I can only run tensorflow on CUDA 10.0 so now I want to downgrade

How to downgrade to cuda 10.0 in arch linux?

我的未来我决定 提交于 2020-02-21 11:03:51
问题 I want to downgrade my cuda 10.1 to cuda 10.0 in arch linux as tensorflow requires cuda 10.0 only. I installed tensorflow on CUDA 10.1 in arch Linux but I didn't know tensorflow-gpu needs CUDA 10.0 or lesser. I tried tried symlinking the required 10.0 libraries with new 10.1 libraries but it didn't work. Whenever I try to import tensorflow in python console error shows up that 'libcublas.so.10.0' not found. So I found out that I can only run tensorflow on CUDA 10.0 so now I want to downgrade

What is the difference between backpropagation and reverse-mode autodiff?

心已入冬 提交于 2020-02-21 10:26:13
问题 Going through this book, I am familiar with the following: For each training instance the backpropagation algorithm first makes a prediction (forward pass), measures the error, then goes through each layer in reverse to measure the error contribution from each connection (reverse pass), and finally slightly tweaks the connection weights to reduce the error. However I am not sure how this differs from the reverse-mode autodiff implementation by TensorFlow. As far as I know reverse-mode

What is the difference between backpropagation and reverse-mode autodiff?

余生长醉 提交于 2020-02-21 10:24:27
问题 Going through this book, I am familiar with the following: For each training instance the backpropagation algorithm first makes a prediction (forward pass), measures the error, then goes through each layer in reverse to measure the error contribution from each connection (reverse pass), and finally slightly tweaks the connection weights to reduce the error. However I am not sure how this differs from the reverse-mode autodiff implementation by TensorFlow. As far as I know reverse-mode

TensorFlow Graph to Keras Model?

依然范特西╮ 提交于 2020-02-20 06:07:31
问题 Is it possible to define a graph in native TensorFlow and then convert this graph to a Keras model? My intention is simply combining (for me) the best of the two worlds. I really like the Keras model API for prototyping and new experiments, i.e. using the awesome multi_gpu_model(model, gpus=4) for training with multiple GPUs, saving/loading weights or whole models with oneliners, all the convenience functions like .fit() , .predict() , and others. However, I prefer to define my model in

How to fix RuntimeError “Expected object of scalar type Float but got scalar type Double for argument”?

折月煮酒 提交于 2020-02-19 09:32:07
问题 I'm trying to train a classifier via PyTorch. However, I am experiencing problems with training when I feed the model with training data. I get this error on y_pred = model(X_trainTensor) : RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #4 'mat1' Here are key parts of my code: # Hyper-parameters D_in = 47 # there are 47 parameters I investigate H = 33 D_out = 2 # output should be either 1 or 0 # Format and load the data y = np.array( df['target'] )

Tensorflow: Simple 3D Convnet not learning

回眸只為那壹抹淺笑 提交于 2020-02-19 06:56:45
问题 I am trying to create a simple 3D U-net for image segmentation , just to learn how to use the layers. Therefore I do a 3D convolution with stride 2 and then a transpose deconvolution to get back the same image size. I am also overfitting to a small set (test set) just to see if my network is learning. I created the same net in Keras and it works just fine. Now I want to create in tensorflow but I been having trouble with it. The cost changes slightly but no matter what I do (reduce learning

unable to use Trained Tensorflow model

风格不统一 提交于 2020-02-19 05:07:21
问题 I am new to Deep Learning and Tensorflow. I retrained a pretrained tensorflow inceptionv3 model as saved_model.pb to recognize different type of images but when I tried to use the fie with below code. with tf.Session() as sess: with tf.gfile.FastGFile("tensorflow/trained/saved_model.pb",'rb') as f: graph_def = tf.GraphDef() tf.Graph.as_graph_def() graph_def.ParseFromString(f.read()) g_in=tf.import_graph_def(graph_def) LOGDIR='/log' train_writer=tf.summary.FileWriter(LOGDIR) train_writer.add