deep-learning

SVC classifier taking too much time for training

你说的曾经没有我的故事 提交于 2020-01-24 01:05:03
问题 I am using SVC classifier with Linear kernel to train my model. Train data: 42000 records model = SVC(probability=True) model.fit(self.features_train, self.labels_train) y_pred = model.predict(self.features_test) train_accuracy = model.score(self.features_train,self.labels_train) test_accuracy = model.score(self.features_test, self.labels_test) It takes more than 2 hours to train my model. Am I doing something wrong? Also, what can be done to improve the time Thanks in advance 回答1: There are

How to specify preemptible GPU Deep Learning Virtual Machine on GCP

一曲冷凌霜 提交于 2020-01-23 12:04:49
问题 I can't figure out how to specify preemptible GPU Deep Learning VM on GCP This what I used: export IMAGE_FAMILY="tf-latest-gpu" export ZONE="europe-west4-a " export INSTANCE_NAME="deeplearning" gcloud compute instances create $INSTANCE_NAME \ --zone=$ZONE \ --image-family=$IMAGE_FAMILY \ --image-project=deeplearning-platform-release \ --maintenance-policy=TERMINATE \ --accelerator='type=nvidia-tesla-v100,count=2' \ --metadata='install-nvidia-driver=True' Thank you! 回答1: You can create a

How to compute gradients with tf.scatter_sub?

我们两清 提交于 2020-01-23 03:43:46
问题 When implementing lambda-opt(an algorithm published on KDD'19) in tensorflow, I came across a problem to compute gradients with tf.scatter_sub 。 θ refers to an embedding matrix for docid. The formulation is θ(t+1)=θ(t) - α*(grad+2*λ*θ), delta = theta_grad_no_reg.values * lr + 2 * lr * cur_scale * cur_theta next_theta_tensor = tf.scatter_sub(theta,theta_grad_no_reg.indices,delta) then I use θ(t+1) for some computation. Finally, I want to compute gradients with respect to λ, not θ. But the

Understanding CTC loss for speech recognition in Keras

删除回忆录丶 提交于 2020-01-23 02:01:12
问题 I am trying to understand how CTC loss is working for speech recognition and how it can be implemented in Keras. What i think i understood (please correct me if i'm wrong!) Grossly, the CTC loss is added on top of a classical network in order to decode a sequential information element by element (letter by letter for text or speech) rather than directly decoding an element block directly (a word for example). Let's say we're feeding utterances of some sentences as MFCCs. The goal in using CTC

How to build this custom layer in Keras?

[亡魂溺海] 提交于 2020-01-22 15:45:05
问题 I'm building a NN that supports complex numbers. Currently working on complex activation. According to a Benjio paper, this is a good one: Where b is a trainable parameter to be learnt . So I'm building a special layer to do this activation. I'm new to Keras and stuck already. I created this code below, but it gives an error with the build function. I have no idea what's happening, I just tried to copy the template. Please help. class modrelu(Layer): def __init__(self, **kwargs): super

Jupyter Notebook (only) Memory Error, same code run in a conventional .py and works

北慕城南 提交于 2020-01-22 14:06:09
问题 I have an assignment for a Deep Learning class, and they provide a Jupyter notebook as a base code, the thing is that after running the data import and reshape, jupyter notebook through a "Memory Error", after some analysis y tried to compile the same code in a normal .py file, and everything runs well. The thing is that I'm required (preferably) to use the Jupyter notebook as the base for development, since is more interactive for the kind of task. <ipython-input-2-846f80a40ce2> in <module>(

What exactly is gradient checking?

◇◆丶佛笑我妖孽 提交于 2020-01-22 11:43:13
问题 I am a beginner in Deep Learning. I came through the concept of 'Gradient Checking'. I just want to know, what is it and how it could help to improve the training process? 回答1: Why do we need Gradient Checking? Back prop as an algorithm has a lot of details and can be a little bit tricky to implement. And one unfortunate property is that there are many ways to have subtle bugs in back prop. So that if you run it with gradient descent or some other optimizational algorithm, it could actually

What exactly is gradient checking?

旧城冷巷雨未停 提交于 2020-01-22 11:42:05
问题 I am a beginner in Deep Learning. I came through the concept of 'Gradient Checking'. I just want to know, what is it and how it could help to improve the training process? 回答1: Why do we need Gradient Checking? Back prop as an algorithm has a lot of details and can be a little bit tricky to implement. And one unfortunate property is that there are many ways to have subtle bugs in back prop. So that if you run it with gradient descent or some other optimizational algorithm, it could actually

Check the total number of parameters in a PyTorch model

主宰稳场 提交于 2020-01-22 04:31:32
问题 How to count the total number of parameters in a PyTorch model? Something similar to model.count_params() in Keras. 回答1: PyTorch doesn't have a function to calculate the total number of parameters as Keras does, but it's possible to sum the number of elements for every parameter group: pytorch_total_params = sum(p.numel() for p in model.parameters()) If you want to calculate only the trainable parameters: pytorch_total_params = sum(p.numel() for p in model.parameters() if p.requires_grad)

Check the total number of parameters in a PyTorch model

你离开我真会死。 提交于 2020-01-22 04:31:10
问题 How to count the total number of parameters in a PyTorch model? Something similar to model.count_params() in Keras. 回答1: PyTorch doesn't have a function to calculate the total number of parameters as Keras does, but it's possible to sum the number of elements for every parameter group: pytorch_total_params = sum(p.numel() for p in model.parameters()) If you want to calculate only the trainable parameters: pytorch_total_params = sum(p.numel() for p in model.parameters() if p.requires_grad)