Neural Network Architecture for Graph Inputs [closed] - python

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.

Related

How to determine the amount of layers and unit count in price prediction with Machine Learning and LSTM? [closed]

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

Tensorflow gradient wrt input [closed]

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.

Deep learning with data from simulations [closed]

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

How to train using neural network in python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am in my final year Project. In my project,I will collect data from a specific road. I have choosen 5 points in that road.From each point i will collect data from GPS about which day of the week,time of the day and time Taken to reach from previous point to that point.
I want to train neural network using this data.
So,the input is which day of the week,time,source and destination & output will be the time needed to reach the destination point from the source point.
What will be easiest to complete this job in python? which library should i choose?
I don't actually know about the conditions of you final year's project, but just a few sidenotes:
Using 4 inputs to your perceptron layer (weekday, hourofday, source, destination) to predict one final neuron (timedelta), you will most likely not need the non-linear powers of a neural network.
If you collect data on your own, you will most likely have too few observations to actually train a neural network. And with too few observations, it will probably overfit to your data.
You are very likely perfectly fine with a linear regression.
If you want to try using a neural network whatsoever, take a look at h2o - it offers a broad variety of machine learning / AI functionality to train models and make predictions.
However, to me it seems that you may require additional reading on this topic. You must understand how to interpret results (if any) and you should know about the pros and cons of each method - this includes knowing about data types and values being appropriate or not for certain models to be applied.

Understanding scikit neural network parameters [closed]

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

Categories

Resources