keras

Google Colab - Where is the output saved?

佐手、 提交于 2021-02-18 16:33:18
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Google Colab - Where is the output saved?

久未见 提交于 2021-02-18 16:32:45
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Google Colab - Where is the output saved?

自闭症网瘾萝莉.ら 提交于 2021-02-18 16:31:52
问题 I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name )` where is the file saved? I cannot find it in my drive anywhere. 回答1: First, mount your drive: !mkdir -p drive !google-drive-ocamlfuse drive Now, append your path: import sys sys.path.append('drive/Project') You should be able to see your files on your local and web-based

Keras network can never classify the last class

核能气质少年 提交于 2021-02-18 10:50:29
问题 I have been working on my project Deep Learning Language Detection which is a network with these layers to recognise from 16 programming languages: And this is the code to produce the network: # Setting up the model graph_in = Input(shape=(sequence_length, number_of_quantised_characters)) convs = [] for i in range(0, len(filter_sizes)): conv = Conv1D(filters=num_filters, kernel_size=filter_sizes[i], padding='valid', activation='relu', strides=1)(graph_in) pool = MaxPooling1D(pool_size=pooling

How to build a Neural Network with sentence embeding concatenated to pre-trained CNN

醉酒当歌 提交于 2021-02-18 08:48:40
问题 I want to build a neural network that will take the feature map from the last layer of a CNN (VGG or resnet for example), concatenate an additional vector (for example , 1X768 bert vector) , and re-train the last layer on classification problem. So the architecture should be like in: but I want to concat an additional vector to each feature vector (I have a sentence to describe each frame). I have 5 possible labels , and 100 frames in the input frames. Can someone help me as to how to

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))

从零开始学Keras(一)

烂漫一生 提交于 2021-02-18 01:52:19
点击上方“ 计算机视觉cv ”即可“进入公众号” 重磅干货第一时间送达 计算机视觉cv 【 导读 】Keras是一个由Python编写的开源人工神经网络库,可以作为Tensorflow、和Theano的高阶应用程序接口,进行深度学习模型的设计、调试、评估、应用和可视化。本系列将教你如何从零开始学Keras,从搭建神经网络到项目实战,手把手教你精通Keras。相关内容参考《Python深度学习》这本书。 初识神经网络   我们先来看一个具体的神经网络示例,使用 Python 的 Keras 库来学习手写数字分类。如果你没用过 Keras或类似的库,可能无法立刻搞懂这个例子中的全部内容。甚至你可能还没有安装 Keras。没关系,可以看个例子先感受下。   我们这里要解决的问题是,将手写数字的灰度图像(28 像素×28 像素)划分到 10 个类别 中(0~9)。我们将使用 MNIST 数据集,它是机器学习领域的一个经典数据集,其历史几乎和这 个领域一样长,而且已被人们深入研究。这个数据集包含 60 000 张训练图像和 10 000 张测试图 像,由美国国家标准与技术研究院(National Institute of Standards and Technology,即 MNIST 中 的 NIST)在 20 世纪 80 年代收集得到。你可以将“解决”MNIST 问题看作深度学习的