deep-learning

Get output from a non final keras model layer

a 夏天 提交于 2021-02-18 06:53:15
问题 I am using ubuntu with python 3 and keras over tensorflow, I am trying to create a model using transfer learning from a pre trained keras model as explained here: I am using the following code import numpy as np from keras.applications import vgg16, inception_v3, resnet50, mobilenet from keras import Model a = np.random.rand(1, 224, 224, 3) + 0.001 a = mobilenet.preprocess_input(a) mobilenet_model = mobilenet.MobileNet(weights='imagenet') mobilenet_model.summary() inputLayer = mobilenet_model

Prediction is depending on the batch size in Keras

岁酱吖の 提交于 2021-02-18 05:13:51
问题 I am trying to use keras for binary classification of an image. My CNN model is well trained on the training data (giving ~90% training accuracy and ~93% validation accuracy). But during training if I set the batch size=15000 I get the Figure I output and if I set the batch size=50000 I get Figure II as the output. Can someone please tell what is wrong? The prediction should not depend on batch size right? Code I am using for prediction : y=model.predict_classes(patches, batch_size=50000

Prediction is depending on the batch size in Keras

断了今生、忘了曾经 提交于 2021-02-18 05:13:10
问题 I am trying to use keras for binary classification of an image. My CNN model is well trained on the training data (giving ~90% training accuracy and ~93% validation accuracy). But during training if I set the batch size=15000 I get the Figure I output and if I set the batch size=50000 I get Figure II as the output. Can someone please tell what is wrong? The prediction should not depend on batch size right? Code I am using for prediction : y=model.predict_classes(patches, batch_size=50000

Keras - Autoencoder accuracy stuck on zero

限于喜欢 提交于 2021-02-18 03:21:41
问题 I'm trying to detect fraud using autoencoder and Keras. I've written the following code as a Notebook: import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn.preprocessing import StandardScaler from keras.layers import Input, Dense from keras.models import Model import matplotlib.pyplot as plt data = pd.read_csv('../input/creditcard.csv') data['normAmount'] = StandardScaler().fit_transform(data['Amount'].values.reshape(-1, 1))

What exactly is timestep in an LSTM Model?

拥有回忆 提交于 2021-02-18 00:57:40
问题 I am a newbie to LSTM and RNN as a whole, I've been racking my brain to understand what exactly is a timestep. I would really appreciate an intuitive explanation to this 回答1: Let's start with a great image from Chris Olah's blog (a highly recommended read btw): In a recurrent neural network you have multiple repetitions of the same cell. The way inference goes is - you take some input (x 0 ), pass it through the cell to get some output 1 (depicted with black arrow to the right on the picture)

What exactly is timestep in an LSTM Model?

牧云@^-^@ 提交于 2021-02-18 00:52:34
问题 I am a newbie to LSTM and RNN as a whole, I've been racking my brain to understand what exactly is a timestep. I would really appreciate an intuitive explanation to this 回答1: Let's start with a great image from Chris Olah's blog (a highly recommended read btw): In a recurrent neural network you have multiple repetitions of the same cell. The way inference goes is - you take some input (x 0 ), pass it through the cell to get some output 1 (depicted with black arrow to the right on the picture)

What exactly is timestep in an LSTM Model?

左心房为你撑大大i 提交于 2021-02-18 00:51:12
问题 I am a newbie to LSTM and RNN as a whole, I've been racking my brain to understand what exactly is a timestep. I would really appreciate an intuitive explanation to this 回答1: Let's start with a great image from Chris Olah's blog (a highly recommended read btw): In a recurrent neural network you have multiple repetitions of the same cell. The way inference goes is - you take some input (x 0 ), pass it through the cell to get some output 1 (depicted with black arrow to the right on the picture)

How to install Openface in windows python

坚强是说给别人听的谎言 提交于 2021-02-17 22:49:07
问题 I am a newbie to Openface. Due to some reasons I want to install Openface in windows with python. It would be great if anyone could guide me through that. I have searched online, but not a single article talks about windows python installation. May be I am asking a very simple question but please help me through this. 回答1: I'm not aware of OpenFace being used on Windows directly, but please contribute any changes necessary to the repository if you start working on this. I expect there to be a

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [1024, 64, 3, 3], but got input of size [32, 10] instead

不想你离开。 提交于 2021-02-17 05:48:52
问题 This line works fine self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False) I introduced ResNet18 self.conv = ResNet18() **ResNet Class** '''ResNet in PyTorch. For Pre-activation ResNet, see 'preact_resnet.py'. Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): expansion = 1 def __init__(self, in

RuntimeError: Expected 4-dimensional input for 4-dimensional weight [1024, 64, 3, 3], but got input of size [32, 10] instead

情到浓时终转凉″ 提交于 2021-02-17 05:48:07
问题 This line works fine self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1, bias=False) I introduced ResNet18 self.conv = ResNet18() **ResNet Class** '''ResNet in PyTorch. For Pre-activation ResNet, see 'preact_resnet.py'. Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): expansion = 1 def __init__(self, in