neural-network

Having problems saving a neural net plot using neuralnet package - R

。_饼干妹妹 提交于 2019-12-23 09:13:15
问题 I'm using the neuralnet package in R, however am having problems saving the plot to disk. data(iris) attach(iris) library(neuralnet) nn <- neuralnet(as.numeric(Species) ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width, data = iris) png("test.png") plot(nn) dev.off() Have attempted to refere to the manual, in the section plot.nn() it says: file a character string naming the plot to write to. If not stated, the plot will not be saved. However doing the following yields no valid plot

Max over time pooling in Keras

浪尽此生 提交于 2019-12-23 07:47:13
问题 I'm using CNNs in Keras for an NLP task and instead of max pooling, I'm trying to achieve max over time pooling. Any ideas/hacks on how to achieve this? What I mean by max over time pooling is to pool the highest value, no matter where they are in the vector 回答1: Assuming that your data shape is (batch_size, seq_len, features) you may apply: seq_model = Reshape((seq_len * features, 1))(seq_model) seq_model = GlobalMaxPooling1D()(seq_model) 来源: https://stackoverflow.com/questions/41958115/max

make pycaffe fatal error: 'Python.h' file not found

纵然是瞬间 提交于 2019-12-23 07:38:51
问题 I compiled caffe on a mac running OSX 10.9.5 and I know trying to compile pycaffe. When I run make pycaffe in the caffe root folder, I get: CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp python/caffe/_caffe.cpp:1:10: fatal error: 'Python.h' file not found #include <Python.h> // NOLINT(build/include_alpha) ^ 1 error generated. make: *** [python/caffe/_caffe.so] Error 1 how can I fix this? Perhaps is something wrong with Makefile.config. How do I know what is my PYTHONPATH? 回答1:

Keras error: expected dense_input_1 to have 3 dimensions

南楼画角 提交于 2019-12-23 07:26:12
问题 I am trying out a simple model in Keras, which I want to take as input a matrix of size 5x3. In the below example, this is specified by using input_shape=(5, 3) when adding the first dense layer. from keras.models import Sequential from keras.layers import Dense, Activation from keras.optimizers import Adam import numpy as np model = Sequential() model.add(Dense(32, input_shape=(5, 3))) model.add(Activation('relu')) model.add(Dense(32)) model.add(Activation('relu')) model.add(Dense(4)) adam =

FANN XOR training

为君一笑 提交于 2019-12-23 05:25:06
问题 I am developing a piece of software that uses FANN, the Fast Artificial Neural Network library. I have tried after numerous failed attempts at writing my own ANN code to compile a FANN sample program, here the C++ XOR approximation program. Here is the source. #include "../include/floatfann.h" #include "../include/fann_cpp.h" #include <ios> #include <iostream> #include <iomanip> using std::cout; using std::cerr; using std::endl; using std::setw; using std::left; using std::right; using std:

Neural Network – Predicting Values of Multiple Variables

痞子三分冷 提交于 2019-12-23 05:16:04
问题 I have data with columns A, B, C as inputs and columns D, E, F, G as outputs. The table has a shape (1000,7). I would like to train the model, validate and test it. My data: A = [100, 120, 140, 160, 180, 200, 220, 240, 260, 280]; B = [300, 320, 340, 360, 380, 400, 420, 440, 460, 480]; C = [500, 520, 540, 560, 580, 600, 620, 640, 660, 680]; My desired outcome: For each combination of A, B, C --> I get D, E, F, G as outputs (for example) : D = 2.846485609 E = 5.06656901 F = 3.255358183 G = 5

Tensorflow Train on incomplete batch

限于喜欢 提交于 2019-12-23 05:13:29
问题 I'm trying to do training with batches in tensorflow. This works a little since I can do the first epoch in batches. I currently have 2 problems with my code. 1. After the first epoch has finished the second epoch immediatly goes to the except tf.errors.OutOfRangeError and the next epoch doesn't restart the batch from the top. How can I do another epoch where it gives batches again? 2. I print the batchnr and I notice that the last batch of the epoch prints print(batchnr) but doesn't print

Food101 SqueezeNet Caffe2 number of iterations

老子叫甜甜 提交于 2019-12-23 05:05:07
问题 I am trying to classify the ETH Food-101 dataset using squeezenet in Caffe2. My model is imported from the Model Zoo and I made two types of modifications to the model: 1) Changing the dimensions of the last layer to have 101 outputs 2) The images from the database are in NHWC form and I just flipped the dimensions of the weights to match. (I plan on changing this) The Food101 dataset has 75,000 images for training and I am currently using a batch size of 128 and a starting learning rate of

how to make train.txt file in caffe

浪尽此生 提交于 2019-12-23 04:57:08
问题 I am using caffe net with python. I have train.txt file like this: train/1175-c/b0a1.bmp b0a1 train/1175-c/b0a2.bmp b0a2 train/1175-c/b0a3.bmp b0a3 train/1175-c/b0a4.bmp b0a4 train/1175-c/b0a5.bmp b0a5 train/1175-c/b0a6.bmp b0a6 train/1175-c/b0a7.bmp b0a7 train/1175-c/b0a8.bmp b0a8 train/1175-c/b0a9.bmp b0a9 train/1175-c/b0aa.bmp b0aa my questions: Can I use hex instead of int at the end of each line? About the label, does it need to start from 0 Or Should I change the above to: train/1175-c

Caffe Unknown bottom blob

╄→гoц情女王★ 提交于 2019-12-23 04:53:31
问题 I'm working with caffe framework and I would like to train the next network: When I execute the next command: caffe train --solver solver.prototxt The error it throws: `F0802 14:31:54.506695 28038 insert_splits.cpp:29] Unknown bottom blob 'image' (layer 'conv1', bottom index 0) *** Check failure stack trace: *** @ 0x7ff2941c3f9d google::LogMessage::Fail() @ 0x7ff2941c5e03 google::LogMessage::SendToLog() @ 0x7ff2941c3b2b google::LogMessage::Flush() @ 0x7ff2941c67ee google::LogMessageFatal::