Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I've been trying to train a neural network to recognise the three types of tags I have images of (circle, rectangle and blank). I used the example set up for recognising the digits dataset provided here and found that I got a 75% correct prediction rate with barely any tweaking (provided my images had a certain level of preprocessing with filters etc).
What I'm interested in understanding more about is the classifier section (code below). I'm not sure what the different convolution and layer options do and what options I have for tweaking them. Does anyone have any advice for other convolution or layers that I could use to try improve my prediction accuracy and what they mean? Apologies for being vague, this is the first time I've touched a NN and am struggling to get my head around it.
nn = Classifier(
layers=[
Convolution('Rectifier', channels=12, kernel_shape=(3, 3), border_mode='full'),
Convolution('Rectifier', channels=8, kernel_shape=(3, 3), border_mode='valid'),
Layer('Rectifier', units=64),
Layer('Softmax')],
learning_rate=0.002,
valid_size=0.2,
n_stable=10,
verbose=True)
I would recommend the excellent video course by Hugo Larochelle on Youtube. The 9th chapter is about convolutional networks and explains all the parameters. You might start from the first two chapters, they explain how the neural networks work in general, and you will get used to the terms like softmax and rectifier.
Another good resource: Andrej Karpathy's lecture notes
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am trying to come up with an experimental solution for a problem related to prediction (similar to stock price prediction).
I've been reading a lot of documentation about using Machine Learning and about stock prices prediction using LSTM (keras and tensorflow). I understand the general theory of machine learning in itself and how a LSTM layer works behind the scenes.
My main concern is that every tutorial about stock price prediction I find, it comes up with a different amount of hidden LSTM layers and each one of them has a pre-defined number of units without much explanation. In the case of the classic "Apple (AAPL) stock price prediction" scenario, I see tutorials with 3 layers and 50 units, others with only 2 layers but 128 units.
In the case I have to code something by myself, how can I determine the amount of LSTM and the amount of units for the prediction to function properly? My main guess at the moment is trying to figure it out with trials and errors. I was wondering if there is some sort of relation between the problem, the data and the solution.
Also if someone can explain the effects of having more/less LSTM layers and more/less units other than doing more calculations, it would be awesome!
A good method is to start with a small dataset, with a few features.
Create a very simple neural model and try to train it on this set.
If your net predicts the test-set correctly, it complicates the dataset and re-train.
But , if net does not work, it increases its size, by adding nodes or layer.
When dataset is full of all features, you have a best network for this task
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have seen it on Shutterstock or on many websites. if you upload an image with automatically generate suggested tags.
That's commonly done using (Deep) Artificial Neural Networks (NNs).
The idea is that you feed an image into a trained NN model and it will predict a classification of the entire image, detect objects present in the image, or even label regions inside the image. There's a lot of freedom in what can be achieved. Since good models are not easy to obtain (without large amounts of data and intense training resources), there exist pretrained models that can be finetuned by the user in order to make it work on your own particular dataset (unfortunately, these models are often somewhat overfit to the dataset they have been trained on such that finetuning is necessary most of the time). I think this link will point you further into the direction how these automatically suggested tags can be generated.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have an undirected graph with edges of equal distance with 7 features per node. I want to train a Neural Network with this graph as an input and output a scalar. What network architecture do I need for my network to analyse the graph locally (for example, a node and it's neighbours) and to generalise, much like Convolutional Neural Networks operate on grid data. I have heard of Graph Neural Networks however I don't know if this is what i'm looking for. Will it be able to analyse my graph much like a CNN does with an image, sharing the generalisation benefits that convolution kernels bring?
I want to implement the solution in TensorFlow, ideally with Keras.
Thank you
The performance will most likely depend on the exact output that you're hoping to get. From your description a 2D-CNN should be good enough and easier to implement with Keras than a GNN.
However, there are some advantages to retaining the graph structure from your data. I think this is too much to present here, but you can find a proper explanation on "Spatio-Temporal Analysis and Prediction of Cellular Traffic in Metropolis" by Wang et al.
This paper also has the benefit of describing data processing to input into the network.
If you don't want to use basic Keras models to assemble your own GNN you may also want to take a look at Spektral, which is a python library for graph deep learning.
Without any other constraints I would firstly use a CNN, because it will be faster to implement with almost ready to use models from Keras.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm experimenting with recent ideas coming from adversarial training and I'm specifically interested in a loss function which includes the input. This means I would like to derive the loss function with respect to the input (not only the model parameters).
One solution I can see is the function tf.conv2d_backprop_input(...). This can work as a solution for conv layers, however I also require a solution for fully connected layers as well. Another way to approach this problem is using the Cleverhans library written by Ian Goodfellow and Nicolas Papernot. This can be a more "complete" solution however its usage is not exactly clear (I need a simple example and not a complete API).
I would love to hear your thoughts and methodology on creating a custom deep learning simulation with adverserial training.
The dependence of an output node on the input can be calculated by backpropagation and is called saliency. It can be used to understand which parts of an input are most strongly contributing to a neuron's output for any differentiable neural network. This repository contains a collection of methods for calculating saliency and links to papers.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
While reading the great book by F. Chollet, I'm experimenting with Keras / Tensorflow, on a simple Sequential model that I train on simulated images, which come from a physical analytical model.
Having full control of the simulations, I wrote a generator which produces an infinite stream of data and label batches, which I use with fit_generator in Keras. The data so generated are never identical, plus I can add some random noise to each image.
Now I'm wondering: is it a problem if the model never sees the same input data from one epoch to the next?
Can I assume my problems in getting the loss down are not due to the fact that the data are "infinite" (so I only have to concentrate on hyper parameters tuning)?
Please feel free if you have any advice for dealing with DL on simulated data.
A well trained network will pick up on patterns in the data, prioritizing new data over old. If your data comes from a constant distribution this doesn't matter, but if that distribution is changing over time it should adapt (slowly) to the more recent distribution.
The fact that the data is never identical does not matter. Most trained networks use some form of data augmentation (e.g. for image processsing, it is common for images to be randomly cropped, rotated, resized, and have color manipulations applied etc, so each example is never identical even if it comes from the same base image).