neural-network

How to use MLP (Multilayer Perceptron) in R?

女生的网名这么多〃 提交于 2019-12-22 01:17:55
问题 I want to train my data using multilayer perceptron in R and see the evaluation result like 'auc score'. There is a package named "monmlp" in R, however I don't know how to use it correctly. I wrote the following code > mlp.model = monmlp.fit(x, y, hidden1=3, n.ensemble=15, monotone=1, bag=T) ** Ensemble 1 ** Bagging on 1 0.9206784 ** 0.9206784 ** Ensemble 2 ** Bagging on 1 0.8200886 ** 0.8200886 ** Ensemble 3 ** Bagging on 1 0.8278868 ** 0.8278868 . . . ** Ensemble 15 ** Bagging on 1 0

How to convert deep learning gradient descent equation into python

对着背影说爱祢 提交于 2019-12-22 01:05:11
问题 I've been following an online tutorial on deep learning. It has a practical question on gradient descent and cost calculations where I been struggling to get the given answers once it was converted to python code. Hope you can kindly help me get the correct answer please Please see the following link for the equations used Click here to see the equations used for the calculations Following is the function given to calculate the gradient descent,cost etc. The values need to be found without

Can't approximate simple multiplication function in neural network with 1 hidden layer

你。 提交于 2019-12-22 00:52:25
问题 I just wanted to test how good can neural network approximate multiplication function (regression task). I am using Azure Machine Learning Studio. I have 6500 samples, 1 hidden layer (I have tested 5 /30 /100 neurons per hidden layer), no normalization. And default parameters Learning rate - 0.005, Number of learning iterations - 200, The initial learning weigh - 0.1, The momentum - 0 [description]. I got extremely bad accuracy, close to 0. At the same time boosted Decision forest regression

Using the TimeSeriesNnet() method from the nnet_ts module throws NameError

独自空忆成欢 提交于 2019-12-22 00:44:19
问题 I am trying to create a neural network using the python module nnet-ts. It has a built-in method named TimeSeriesNnet(), which takes two arguments; hidden_layers and activation_functions. See documentation for this module, as well as example in the README.md: https://github.com/hawk31/nnet-ts I am running python version 2.7.13 The nnet-ts module has dependencies to 5 particular packages, which I am listing below together with the current versions I am using: numpy-1.13.0, pandas-0.20.2, scipy

When I use TensorFlow to decode `csv` file, how can I apply 'tf.map_fn' to SparseTensor?

别来无恙 提交于 2019-12-22 00:26:40
问题 When I used following codes import tensorflow as tf # def input_pipeline(filenames, batch_size): # # Define a `tf.contrib.data.Dataset` for iterating over one epoch of the data. # dataset = (tf.contrib.data.TextLineDataset(filenames) # .map(lambda line: tf.decode_csv( # line, record_defaults=[['1'], ['1'], ['1']], field_delim='-')) # .shuffle(buffer_size=10) # Equivalent to min_after_dequeue=10. # .batch(batch_size)) # # Return an *initializable* iterator over the dataset, which will allow us

Training dataset generator in OpenCV

瘦欲@ 提交于 2019-12-22 00:16:45
问题 I'm working on my bachaleor theses called "Traffic sign detection in image and video" and I'm using neural network called YOLO (You Only Look Once). I think its name is pretty self-explaining, but paper may be found here. This network is learning from not-cropped annotated images (Regular networks use to train on cropped images). To be able to learn this network, i need not-cropped annotated european traffic signs dataset. I wasn't able to find any, even not here, so i decided to generate my

How to predict using trained Tensorflow model

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 23:16:43
问题 I have created and trained a neural network but I would like to be able to input test points and see its results (rather than using an eval function). The model runs fine and the cost reduces every epoch, but I just want to add a line at the end to pass some input coordinates and have it tell me the predicted transformed coordinates. import tensorflow as tf import numpy as np def coordinate_transform(size, angle): input = np.random.rand(size, 2) output = np.zeros((size, 2)) noise = 0.05*(np

Keras getting output of intermidate layers

余生颓废 提交于 2019-12-21 22:40:18
问题 ## what my model looks like # defining the model archictecture model = Sequential() # 1st conv layer model.add(Conv2D(32, (5, 5), activation='relu', input_shape=x_ip_shape)) # 1st max pool model.add(MaxPooling2D(pool_size=(2, 2))) # 2nd conv layer model.add(Conv2D(64, (7, 7), activation='relu')) # 2nd max pool model.add(MaxPooling2D(pool_size=(2, 2))) # Flattenning the input model.add(Flatten()) # 1st Fully connected layer model.add(Dense(10, activation='relu')) # Adding droput model.add

How does the epsilon hyperparameter affect tf.train.AdamOptimizer?

梦想的初衷 提交于 2019-12-21 22:18:39
问题 When I set epsilon=10e-8 , AdamOptimizer doesn't work. When I set it to 1, it works just fine. 回答1: t <- t + 1 lr_t <- learning_rate * sqrt(1 - beta2^t) / (1 - beta1^t) m_t <- beta1 * m_{t-1} + (1 - beta1) * g v_t <- beta2 * v_{t-1} + (1 - beta2) * g * g where g is gradient variable <- variable - lr_t * m_t / (sqrt(v_t) + epsilon) The epsilon is to avoid divide by zero error in the above equation while updating the variable when the gradient is almost zero. So, ideally epsilon should be a

Extracting probabilities from a softmax layer in [tensorflow 1.00]

核能气质少年 提交于 2019-12-21 21:39:17
问题 Using tensorflow, I have an LSTM classification model with a softmax as the final node. This is my softmax layer: with tf.name_scope("Softmax") as scope: with tf.variable_scope("Softmax_params"): softmax_w = tf.get_variable("softmax_w", [hidden_size, num_classes]) softmax_b = tf.get_variable("softmax_b", [num_classes]) logits = tf.nn.xw_plus_b(output, softmax_w, softmax_b) # Predicted label, eg y = tf.matmul(X, W) + b) loss = tf.nn.sparse_softmax_cross_entropy_with_logits(labels=self.labels,