text:
Finding anomaly detection by pattern matching in a set of continous data
I have series of sensors (around 4k) and each sensor will measure the amplitudes at each point.Suppose I train the neural network with sufficent set of 4k values (N * 4k shape). The machine will find a pattern in the series of values.If the values stray away from the pattern (that is anomaly)  it can detect the point and will be able to say that anomaly is in the 'X'th  sensor.Is this possible.If so what kind of neural network should I use?

Questions. .. Are the sensors correlated in some way or all completely independent? Are they all required, or can you use a subset?

Also, do you HAVE to use a neural network? There are easier ways to achieve this.

Neural Network is not mandatory, any algorithm would do.As of now the sensors seem to be independent.

Without knowing the kind of data and the process generating it it's hard to give a definite answer.
In general, I would attempt a network that has as inputs the actual sensor readings, and outputs the expected readings. You train this network by presenting data with errors added as inputs, and correct readings as outputs.  It should learn to guess the correct (non-anomalous) readings from a set of actual readings, and you can find the sensors with anomalies by taking the difference between actual and predicted readings.
Depending on the kind of anomalies you expect (misreadings such as fluke zero or max values, or actually anomalous states of the system being measured) your training data should be set up to have samples of such anomalies.
If there are temporal correlations (for example, temperature readings that change slowly) using a RNN might be helpful but its dimensioning heavily depends on the nature of your measured system.
External factors influencing the system (state of a heating mechanism, time of day/year, etc.) could be added at inputs for better predictions.
At the end of the day, trial and error is your friend. Start with a simple network and see how well it behaves. Go for more complex networks when you see where the limitations of the simple solution are.

Actually the sensors have different idle values at different points.So an anomaly for one may be normal for other and we don't have data for anomalies at each point (at some certain points we have).

And can you just elaborate the point.Do we have both anomalies and non-anomalies in training? and what I understood is that we have the labels as 'non' anomalous values' ryt? And if the difference between predicted readings and normal  readings are high then as per your explanation is it anomaly or not anomaly?

It depends on what sort of output is more useful to you. If you simply want to identify anomalous values, then the network should be trained to output binary per-sensor labels. But if you actually want to "remove" the anomaly from the values then the network should be used for regression. I suspect the network for the former use-case (binary classification with simple anomalous/non-anomalous labels) will be easier to train, but this is just a shot in the dark given that I don't know the kind of data you're dealing with.

Instead of using a neural network, simply sample as many non-anomalous readings from each sensor as you can. If the distribution of the readings from each sensor is approximately normal (check the skew and kurtosis values for the samples from each sensor) then you can work out mean and standard deviation of the samples and, for any future samples, the value of a particular measurement on a normal probability distribution.
(If your measurements do not have a normal distribution, then you can often apply a transform of some sort to the data make it normal).
So, let's say that you have measured a few thousand typical samples for one of your sensors, confirmed that the distribution is normal and calculated the mean and standard deviation of those samples. You can now calculate where on the normal curve your new sample 'x' would be using:
def gaussian(x, mean, std):
    # check for very small standard deviations
    if(2 * std ** 2 == 0):
        return 0.0

    return (1.0/(math.sqrt(2*math.pi) * std)) * math.exp(-((x-mean)**2)/(2*std**2))

At this point, you can make a decision if the value of the of a particular measurement on that distribution is so low as to be anomalous, and inform the user.
Now, you have probably realised that working out exactly how low a value should be to be considered anomalous might be tricky, and you are correct. The solution is to see if you can get some real anomalous data and use that to set the thresholds. Obviously, this might be rather a job if you have 4000 independent sensors...
If you want to know more about Anomaly Detection then I recommend that you take a look at Andrew Ng's introductory lecture series.


text:
Teaching a neural network to play a card game with two phases
I'm writing a virtual environment for a 4-player card game named estimation, and will use deep reinforcement learning to teach an agent to play it.
Each player gets a hand of 13 cards, and the first phase is for each player to estimate the number of tricks they will collect. The highest player gets to start first,and then after each round, the player who collects the trick starts the next. So basically the first phase is for bidding and the next phase consists of 13 rounds.
The state input I'll use will include all the cards that have been played, the goal and collected tricks, and the available cards. The output for each round will be a vector of length 54, containing all the cards and then the available card with the highest probability would be played.
At first I thought that the bidding phase should use the same input but with zeros everywhere except the available hand, and the output would exclude all the cards with no numbers like king, queen or jack. But then the ability to dash (estimate that you'll collect 0 tricks) wouldn't be available. Also I don't think it would work really well.
Should I just use two NNs for each phase, or what should I do? Also if anyone has any advice on things I need to watch out for, I'd really appreciate it if they shared them.

I've played this game. If I remember correctly, a successful strategy (for winning as many tricks you estimated to win) involves continually evaluating how well you're doing. If you're doing very poorly relative to your initial estimation, that's valuable information to have.
I think you should have one network that outputs--at every time step--both an estimate of future tricks won and an action of which card to play. This has the additional advantage of giving you more estimation experience with which to train. After all rounds, you'll know how far off each of your estimations were throughout the game. This should speed up learning on that part of the game.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
ANN’s single output representing value
Can ANN with only one neuron in output layer be trained in a way that output neuron’s value (0-1) can be representation of some real value, like for example height.
In other words,can neural network given the inputs predict the height of a person by outputing values from 0 to 1. Zero being the 50 cm and 1 being 250cm.Or it will always gravitate to 0 or 1?Can it predict a height of 150cm (0.5) ?

Yes, this is possible. The only restriction on the range of output values is due to the activation function, if there is one. If, for example, the activation function is a sigmoid, the output would be restricted to values between 0 and 1. You can of course choose an activation function best suited to your problem, even if that means having none.
In your case, if you really want the output of your network to be between 50 and 250, you could use a scaled and shifted sigmoid as your activation: 200*sig(w*x+b)+50.
But, as was pointed out in comments below, having a single output neuron may not be the best architecture for this problem.

You may be right. I'm not sure how easy or stable learning would be. Perhaps a better solution outside the constraints of the question would be to frame this as a classification problem with a softmax final activation and cross entropy error. The classes could be something like {<50cm, 50-60cm, ..., 240-250cm, >250cm}

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Game AI design for a multiplayer random board game?
I'm writing an AI for a board game, and previously I would just create a value maximizing state machine and tune the factors one at a time.
However, the issues with this is getting apparent. My last AI did not look into the future, hurting it's long term chances, and manual tuning of weights is proving to be a chore.
I've looked into minimax algorithms, but with a non perfect information game and elements of random chance I'm not too confident it will be effective.
I've also looked into traditional neural networks, but evaluating board states is tricky and the game does not split into moves well.
The game I'm writing the AI for is Ticket To Ride, but I would appreciate tips for any board game with similar mechanics.

Many successful game-playing engines use some form of search to look ahead and plan the next move. This is possible even in stochastic environments by building a tree with probabilities assigned, or by simulating the randomness during planning and relying on lots of samples to get reasonable estimates of value.
There are many approaches possible. However, as Ticket to Ride is a relatively simple game that you could automate to play to the end very quickly (1000s of times per second), then you could look into Monte Carlo Tree Search (MCTS) as a mechanism for the game-playing agents to look ahead and adjust their play to current odds.
The basics of Monte Carlo Tree Search:

On its turn, the agent builds up an evaluation tree local to its current state - each node of the tree is a game state, augmented with statistics from MCTS (how often node was chosen, how many times agent managed to win eventually from that node) and each link is a choice that a player makes. This is built up slowly, typically just adding one node per full simulated game.
For look-ahead search "inside" the tree, the agent explores options according to their relative promise, selecting moves to simulate according to its best estimates of value at the time. It needs to explore alternatives to make sure it doesn't miss anything, and there are a few variations of doing this. One successful approach to action selection inside the tree is Upper Confidence Bound applied to Trees (or UCT for short).
When play gets to a leaf node of the tree, the tree might be expanded slightly, and then afterwards the agent simulates plays of the game either to the end or to a robust evaluation point. This later play might be entirely random - or might still be guided probabilistically by some heuristic - and is called a rollout. The important thing here is to play quickly to get samples just to roughly assess the position at the leaf of the tree.
The evaluation resulting from rollout is fed back into the tree, which builds up sampled statistics of the most promising variations of play.
After a certain number of repeats of the whole algorithm (local tree search, expanding the tree, rollout and update), the agent picks the most promising next step from the tree. At this point it may just discard the whole tree - in a game with lots of randomness, this is probably what you would do now, as things you were considering as just probabilities before will have become historical fact, and the chances are that re-running the tree build from the next start position will be more accurate.

There are a few variants possible, including combinations with neural networks as used in AlphaZero.
The basic principle is to sample from many choices, focusing over time on what looks "best" to each player based on statistics of those choices.
As Ticket To Ride is a card game where cards can be drawn from an unseen deck, and it would be considered cheating to simulate and rollout with the actual deck in play, you would need to have realistic shuffles of the remaining unknown cards used during rollout. It may still work quite well without the realistic part and for speed just assume a random unlimited deck of cards (because re-shuffling on each imagined rollout would be costly).

How does MCTS work with randomness? Most articles on the Web that I've found are for perfect information games. How do I know what moves other people will do if I don't know their state? I could figure it out based on probability or something but I'm not soo syre,

The tree growing stage will need to allow for probabilities of steps happening, I don't know the exact formulation for it. The rollout stage is identical as you are just sampling and you don't need to track anything but a single path (and you could just steal the rollout idea for a very simple improvement to a game with randomness, that's how TD-Gammon worked for backgammon). Knowing what other people will do is about guessing their policies, and potentially training all of them at the same time using the same agent code


text:
Use AI to auto-correlate the words of human-translated texts?
There are many, many literary works in the public domain, along with human translations, many of which have entered the public domain as well. (Public domain = easily available)
In order for me to advance my knowledge of e.g. Japanese, I'd like to read texts in Japanese using a yet to be written tool, and when I encounter an unknown word/phrase/sentence, I'd like to just click on a position in the text and be transferred to the corresponding position in the e.g. English translation (or original) of the text in question.
Let's also assume we have access to a dictionary that translates a fair amount of words between those two languages (and there are of course free dictionaries for many language pairs).
What ways are there to use AI toolkits plus some wiring and perhaps scripting/programming, to auto-correlate the positions of two versions of the same text, in two languages? The results do not - and in fact in many cases cannot - be perfect, but they should be roughly correct.
I'm aware that this is still not a straightforwards task, as there are complicating factors like inflection of verbs and other grammatical properties that make the use of dictionary tools much harder. Also, translators will often translate to words that don't have that mapping in any dictionary. Then there is the fact that words aren't delimited by spaces in languages like my example language Japanese - (but if it is easier to work with only space-separated languages like, say, Spanish, or Russian, I'd like to hear answers to this simpler problem as well). Also the order of words and even hole sub-clauses differs from language to language.
A simple, non-AI approximation would be to

figure out at what relative position in the source language text the user clicked (e.g. at the character on position 50.234%)
then go to that same relative position 50.234% in the target language text

This approximation could perhaps be used as the starting point for the AI, which would then use words and dictionaries to make the results more accurate.

You are basically describing the way Google Translate works.
There has been a lot of research in text alignment in the area of multi-lingual corpus linguistics. An early paper (with sourcode) is Gale and Church's A Program for Aligning Sentences in Bilingual Corpora (PDF).
In linguistics these are called parallel texts. On the wikipedia page you will find links to a number of alignment programs which attempt to solve that issue.

Awesome. Although your answer doesn't spell out a way to implement this, the terms you gave are the nudge I needed to continue my research.

There is C source code in the Gale and Church PDF.


text:
Can AI come up with scientific theories of past when provided with sufficient data available at that time?
I would love to know if an AI model could come up with certain theories of the old like Pythagoras' theorem, Euclid's formulations,
Newton's gravity, Einstein's theories if provided and trained with sufficient amount of observable data available at those period of time. If this is possible can unsolved conjectures be proved by AI? Or even better can AI develop new theories or will it  fail to come up with even basic mathematical operations by itself?

@DuttaA I'd argue that Pearl's work handles the cause/effect side pretty well, but if the goal is just to propose theories from data, then we don't need to establish causality.

@DuttaA Hmm. That's true. Usually the techniques I mentioned in my answer either include a temporal component (which lets you infer the direction of causality for a lot of physical phenomena). Judea Pearl's work actually goes further than that though, and lets you rule out a lot (perhaps all but one) casual story from data without a temporal component.

Yes.
Some good examples of this are Lipson's work using evolutionary models, and Wu & Tegmark's work on a theory-based life-long learner, and Iten et al.'s work with deep neural networks. There are many, many, other research papers in this area, and there is a lot more work that is ongoing. The endgame for a lot of this work is the hope that we can synthesize new theories automatically.

It depends on what is assumed to be known. For instance Newton had to invent differential calculus along the way.


text:
How would an AI visualize a story written in natural language?
Can AI transform natural language text describing real scenarios to visual images and videos ? How does as AI interprets say a Harry Potter story if it has to reproduce it in form of videos ? Would be useful if anyone can help me with the required literature for understanding text to image transformation by AI


text:
Backpropagation: how to take into account different samples quality
I have a NN I'd like to train using supervised learning. Some samples of the training set, however, have better "quality" than others, so I'd like the algorithm to pay "special attention" to them. As general question, how to take this into account in implementation?
Being more specific, I'm working with OpenCV and noticed that the train method apparently have such parameter:
cv2.ANN_MLP.train(inputs, outputs, sampleWeights[, sampleIdx[, params[, flags]]]) → retval

Where:

sampleWeights – (RPROP only) Optional floating-point vector of weights for each sample. Some samples may be more important than
  others for training. You may want to raise the weight of certain
  classes to find the right balance between hit-rate and false-alarm
  rate, and so on.

However OpenCV documentation is unclear on this, so how to handle this parameter?


text:
How to encode card game state into neural network input
I'm trying create neural network to predict moves in a card game.  I am looking for recommendations on encoding the game state to my input layer.  It's a complex turn based collectible card game (think Magic the Gathering).  I need to represent cards being in various areas of the game board (deck, discard pile, hand, etc).  It seems difficult to assign cards to these areas because the number of cards in these areas is never constant.
I was thinking of an approach where I assign each card in the game to being in a specific card area.  The number of total cards in the game should be constant (let's assume that).  This approach I feel should give me a potentially less sparse input.
Also, With this approach what is the best way to handle card duplicates?  Let's say I have 3 copies of the exact same card in my deck.  Maybe 1 of the copies is in my hand and 2 in my discard pile.  It does not matter which of the 3 copies is in my hand because they are all the same exact card.  There is now multiple ways to represent this same exact game state in my network because each individual card has it's own state.  To me this does not seem good.  How much will this effect my neural network's ability to learn the game?

I am not sure what you mean by

There is now multiple ways to represent this same exact game state in my network because each individual card has it's own state. To me this does not seem good.

We can think of game state as a column vector of the form $1Xn$. In this case, you can formalize cards held according to some encoding. This can be anything from a Gödel Numbering to simple integer assignment. Here is an example for poker in python: https://pypi.org/project/treys/
In the example of duplicates you would have a column vector that simply has duplicate indices. I.e: {241, 424, 112, 112, 455}$

In this case your column vector has indices indicating the card. I mentioned in my question that this doesn't work well because in order to represent a players hand your column vector is of variable size. Instead consider the column to be a specific card in the game and the indices to be the current state of that card (deck,hand,discard,etc)

@ngroover Why not just pad the vector?

I guess that's part of my question is lots of padding bad? Does the network even learn correctly if there is more zero padding than actual relevant data? It seems to me that it would not work well

@ngroover, well I assume that n cards aren't possible? I.e you can't have 100000 cards. If they aren't just set the pad to the upper bound and 0 or similar encoding will represent a empty card 'slot'. You would only likely run into trouble in training an agent if the possible cards was in the hundreds


text:
Siamese Network for unknown object
I am currently trying to create a One-Shot network using the Siamese architecture for an object that isn't a face.
My problem is, in normal Face Recognition the detecting gadget (e.g. Smartphone) knows which image it should compare the face, currently trying to unlock the tool, to.
In my case, I don't know the object's identity so I would have to compare every other object in the database to it.
Is there a better, more efficient way of checking the identity of the object without comparing it to any other object. A normal classification doesn't work in my case, because new unknown objects can be added any time.

You can store the embeddings of objects and just compare the embeddings, or store multiple and hen use something like kNN


text:
How do I detect similar objects in an image?
I want to tackle the problem of detecting similar objects in an image. To illustrate the problem consider this photo of some Lego bricks as my "input":

The detection routine should identify similar objects. So for the given input, it should e.g. identify the following output:

So an object might appear none to multiple times in the input image. For example, there are only two bricks marked with a blue cross, but three bricks marked with a red cross.
It can be assumed that all objects are of similar kind, so e.g. only Lego bricks or a heap of sweets.
My initial idea is to apply a two-phased approach:

Extract all objects in input image.
Compare those extracted objects and find similar ones.

Is this a valid approach or is there already some standard way of solving this kind of problem? Can you give me some pointers how to solve this problem?

Disclaimer: I have never used Siamese networks
I would approach this problem in two steps:
First: train object detector and train it for eligible classes of object, for example using Yolo architecture.
You could use pretrained object detector and finetune it for your classes of objects.
Second: extract a lot of bounding boxes of eligible objects of the same classes from your dataset and train Siamese network on their subimages.
Siamese network output similarity measure between two objects.
Your pipleline would look like:

Run object detetctor
For each two pair of objects of the same class rescale bounding boxes and run Siamese network.
Check if the similarity distance between two objects is less then threshold (tunable hyperparameter)


text:
How to reduce over-fitting on training set?
Currently I'm feeding spectrogram of audio to the CNN with 3 convolution.
Each convolution is followed by a max pool of filter size 2.
First -> 5x5x4
Second - > 5x5x8
Third - > 5x5x16
and final layer is a fully connected with 512 unit.
But while training with dropout of 0.25, getting train accuracy of 0.97 with 150 iterations.
and on test data accuracy is just 0.60.
Tell me how to improve the results.
Yes both train and test data come from same distribution.

What is your dataset size, and how easy is it to get more data? Would your target output remain the same if you altered the audio source - e.g. adding noise, changing speed (or just pitch), etc?

Dataset contains 1k images. because this is a people voice classification problem more data is not available but haven't tried data augmentation. will try and update here.

The problem of overfitting is given that your model is being too flexible with the training data. The approaches you could take will be:

Download pretrained models (VGG-16) and use transfer learning.
Increase the value of your dropout (e.g. from 0.25 to 0.50).
Use data augmentation for your images.
Reduce the number of fully connected layers.


text:
How to perform unsupervised anomaly detection from log file with mostly textual data?
I have a log file of the format,

Index, Date, Timestamp, Module, App, Context, Session, Verbosity level, Description

The log file can be considered as a master log, which consists of individual logs from several modules constituting a distributed system. The individual log can be identified using the corresponding Module+App+Context tags. The verbosity level(Info, Warn, Error, …) and the descriptions(system generated + print statements added by developers) contain further information on the log events necessary for debugging. I need to perform an unsupervised anomaly detection with the log file as input. The output should be the functionality and timestamp of the identified anomalies.
Since the log is mostly textual, I plan to use NLP algorithm (Bag of words/TF-IDF) to convert the data into word vectors and then perform a generative learning method to identify the normal pattern. Can someone suggest if my approach in the right direction? Which headers of the log file would be relevant for the word-vector representation and further analysis?


text:
Why doesn't my image classification network get better with training?
I am attempting to train a network to do something I thought would be a relatively simple case to learn with: identify whether the back of a scanned vintage postcard has one of 'no postage stamp', a '1 cent stamp', or a '2 cent stamp.' The images are 250px by about 150px, RGB color, and there are about two thousand of them. Ballpark 75% of them are no-stamp, 20% 1-cent, and 10% 2-cent.
When I attempt to train the network it seems like it is starting at 70 +/- 1 % accurate and hovers in that range for 50 epochs, never improving. I'm not sure I'm reading the metrics correctly, though, as this doesn't seem quite right.
I set this up by following the tutorial on the Keras blog: https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
I haven't implemented the latter part of the tutorial, where a pre-trained network is used, because I haven't found one that seems like it would be a similar problem.
My training and validation sets are here: https://drive.google.com/open?id=1-TxEKVVvP7RuFC7kFgH7Wt5A8z8QGTR3
And my Google Colab Jupyter notebook is here: https://colab.research.google.com/drive/1UuKDF1wDwYlXszB2ahIrygRnfcs2D_sD

Machine learning unfortunately doesn't necessarily get better with more training data. If the classes in your problem are not clearly separable for the algorithm, then no amount of data will improve it. One issue could be that the classes are unbalanced; perhaps try to use fewer 'no-stamp' images. Or investigate pre-processing them, eg to amplify colours or other features, so that the classifier can pick them up better.

Thanks @OliverMason, I will try that. I was also thinking that maybe I need to make sure the ImageGenerator() isn't cropping the image such that the stamp area is missing.

I forgot that I already did that, re: ImageGenerator(). :\

The answer (as detailed quite thoroughly here and here) is that specifying
model.compile(optimizer = 'rmsprop', loss = 'binary_crossentropy', metrics=['accuracy'])

causes keras to guess, incorrectly, that because I am using binary_crossentropy for the loss function, that I would want to use binary_accuracy as the way of reporting the accuracy metrics. Apparently, one should specify that one wants the categorical_accuracy metrics if one, as I do, has more than two classes.


text:
Is making lot of 1 versus other model efficient?
I've got classification problem on image, I have 10 classes and when I fine tuned my model on it (I tried VGG, Xception, resnet etc) I have approximatly 83% validation accuracy.
I was wondering if doing lot of binary model with 1 class represented and the other as 'other' and then using them to classify my image would be good and efficient ? (I obtain more than 90% val acc for each class doing this)
Except for memory consumption and training time does this method have drawback ?


text:
How do we classify an unrecognised face in face recognition?
If we have classified 1000 people's faces; how do we ensure the network tells us when it encounters a new person?

It's a hard problem, it's called "unknown class" and related to binary classification "one vs all". There is no established solution for it, only several heuristics. Simplest (but not good) is take threshold on probabilities of known classes. There are more complex solution with binary classifiers and hierarchies, but it's all on case-by-case basis.

Specifically for face recognition (and other identification algorithms) there are better approaches than using classifiers directly.
Most identity recognition algorithms generate some kind of metric - typically an "embedding" of the original image into an abstract space i.e. a vector of real numbers. The space might be based on real-world biometrics e.g. normalised measurements of eye distance, eyebrow arch etc, which would be trained as a regression algorithm. The problem with this is that it requires a lot of labelled data, and the biometrics are not necessarily good at differentiating between identities. An alternative is to get the neural network to find the best abstract space for identities. You can do this if you have at least two images of each identity, and using triplet loss to train the network - the loss function directly rewards embedding the same identity close and different identity far apart.
Once you have an embedding, you no longer directly classify identities using the neural network. Instead, you base identity on distance between measured embedding and stored embeddings. This requires implementing a search function that looks at known embeddings and sorts by distance.

how do we ensure the network tells us when it encounters a new person?

Embeddings don't solve this problem directly, but give a useful heuristic - distance in embedding space. Typically a maximum allowed distance is set as a cutoff to consider an image as showing a new identity. This is a hyperparameter of the model. This is an area that triplet loss helps with, since it is trained to make the distance as large as possible between images that show different identities. If it has generalised well during training, then it should ignore differences due to lighting, pose, makeup etc, but still be able to differentiate similar looking people.
As the embedding is approximate, any such system may make mistakes, and needs to be carefully tested. The quality and quantity of training data are important, and it should match images used in production. But that is no different to the pure classifier, which must in addition be re-built and re-trained for every new class added.
Whether to use a more basic classifier or something like triplet loss is a question of scale - if the number of identities that need to be tracked is high, or the rate of change in identities is high, then embeddings trained on triplet loss (or similar) are more practical.

You can't really make the network tell you if a face is new (unless you actually train a network with that particular purpose, maybe). Ideally, if you feed a new face to a trained network, the output activations will be pretty low in all the possible categories (faces that the network has already seen) i.e. no particular category will signal a high probability. In that case, you can just set a cut, such that if the maximum activation is below a certain threshold, it means that the NN encountered a new face. But things are not that easy in practice. If the NN encounters a face it has already seen, but the image is weird (blurry, the face doesn't cover much of the actual image, there are multiple faces in the image etc.) you could get the same output as in the case of a new face. At the same time, for a NN images are just probability distributions, so it could happen that a new face, which for us, humans, looks nothing like the others, to look pretty similar to an old one, from the NN point of view, hence giving a high activation in a single particular output neuron.


text:
LSTM is not converging
I am writing my first LSTM network and I would really appreciate if someone can tell me if it is right (the loss seems to go down very slowly and before playing around with hyper parameters I want to make sure that the code is actually doing what I want). The code is meant to go through some time series and label each point according to some categories. In the version I am putting here there are just 2 categories: 0, if the value of the point is 1 and 1 otherwise (I know it’s a bit weird, but I didn’t choose the labels). So this is the code:
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
from fastai.learner import *

torch.manual_seed(1)
torch.cuda.set_device(0)

bs = 2

x_trn = torch.tensor([[1.0000, 1.0000],
        [1.0000, 0.9870],
        [0.9962, 0.9848],
        [1.0000, 1.0000]]).cuda()

y_trn = torch.tensor([[0, 0],
        [0, 1],
        [1, 1],
        [0, 0]]).cuda()

n_hidden = 5
n_classes = 2

class TESS_LSTM(nn.Module):
    def __init__(self, nl):
        super().__init__()
        self.nl = nl
        self.rnn = nn.LSTM(1, n_hidden, nl)
        self.l_out = nn.Linear(n_hidden, n_classes)
        self.init_hidden(bs)

    def forward(self, input):
        outp,h = self.rnn(input.view(len(input), bs, -1), self.h)
        return F.log_softmax(self.l_out(outp),dim=1)

    def init_hidden(self, bs):
        self.h = (V(torch.zeros(self.nl, bs, n_hidden)),
                  V(torch.zeros(self.nl, bs, n_hidden)))

model = TESS_LSTM(1).cuda()

loss_function = nn.NLLLoss()

optimizer = optim.Adam(model.parameters(), lr=0.01)

for epoch in range(10000):
    model.zero_grad()
    tag_scores = model(x_trn)
    loss = loss_function(tag_scores.reshape(4*bs,n_classes), y_trn.reshape(4*bs))
    loss.backward()
    optimizer.step()

    if epoch%1000==0:
        print("Loss at epoch %d = " %epoch, loss)

print(model(x_trn), y_trn)

The (super reduced in size) time series should be [1,1, 0.9962,1], with labels [0,0,1,0] and [1, 0.9870, 0.9848,1] with labels [0,1,1,0] and the batch size should be 2. I really hope I didn’t mess up the dimensionalities, but I tried to make it in a shape accepted by the LSTM. This is the output:
Loss at epoch 0 = tensor(1.3929, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 1000 = tensor(0.8939, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 2000 = tensor(0.8664, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 3000 = tensor(0.8390, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 4000 = tensor(0.8339, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 5000 = tensor(0.8288, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 6000 = tensor(0.8246, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 7000 = tensor(0.8202, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 8000 = tensor(0.8143, device='cuda:0', grad_fn=<NllLossBackward>)
Loss at epoch 9000 = tensor(0.8108, device='cuda:0', grad_fn=<NllLossBackward>)

(tensor([[[-9.0142e-01, -1.2631e+01],
          [-9.3762e-01, -9.6707e+00]],

         [[-1.3467e+00, -3.9542e+00],
          [-2.2005e+00, -7.6977e-01]],

         [[-2.4500e+01, -1.9363e-02],
          [-2.3349e+01, -6.2210e-01]],

         [[-1.0969e+00, -2.1953e+01],
          [-6.9776e-01, -1.8608e+01]]], device='cuda:0',
        grad_fn=<LogSoftmaxBackward>), tensor([[0, 0],
         [0, 1],
         [1, 1],
         [0, 0]], device='cuda:0'))

The loss doesn’t go down too fast (I expected it to overfit and go really close to zero). The actual values are okish (the smaller one is always the right one), but they can be definitely improved. Can someone tell me if my code is doing what I want (and maybe suggest why is the loss still big - maybe I need a smaller LR?)

Welcome to SE:AI!  This looks like it might be a better fit for Data Science.  (Let me know if you'd like me to migrate.)

@DukeZhou sure, if you think that is better. Thank you!

I tried to play with your code and found changing loss function to the cross_entropy alternate of negative log-likelihood makes the difference between 2000th epoch's loss and  9000th epoch's loss is greater about 0.2 alternate of 0.09
I also tried to change optimizer and learning rate but no loss didn't improve.
you can explore the modified code may help you with another idea

Thank you for your reply! What I am confused about is why don't, for example, the first 2 entries (which should be 0 and 0) get updated. In your example (as well as my tests) they stay at 50% both (i.e. -6.9315e-01). Shouldn't they at least start to move towards the right value, as that would obviously reduce the loss function?


text:
Why validation performance is unstable for my LSTM based model (labelling problems)?
I have trained a recurrent neural network based on 1 stack of LSTM cells. I use it to solve a classification problem.
The RNN cell has 48 hidden states. The output of the last unfolded LSTM cell is linearly projected into two dimensions corresponding to two mutually exclusive classes. I train with softmax cross-entropy loss.
I also know that both my train and test sets are mislabeled(!) to a certain extent. Possibly about 10% of items labelled as class 1 are actually class 0. And the same hold in other direction.
What puzzles me is this. Every time I train the network from scratch and plot a precision recall curve for the validation set in the end. And every time it is different! Especially in the very beginning in the range that corresponds to high precision levels. Why is this happening (this instability)?
I tried various numbers of epochs, training rates, number of hidden states in LSTM. Every time it is the same, but for some combinations of these parameters the variability is less (e.g. 8 out of 10 train/test runs i see more or less the same precision recall curve and 2 times it is severely different and worse).


text:
Running 2 NEAT nets on the same observations
So i have been playing around with neat-python. I made a program, applying neat, to play pinball on the Atari 2600. The code for that can be found in the file test2.py here
Now based on that, I would like to do the same, but on a 2 player game. I have already set up the environment to play a 2 player game, which PONG using OpenAI Retro.
What I have no clue how to do, is run 2 nets at the same time, on the same observation. The way that neat-python works, is you get the observation from a single function that goes through each genome and runs the environment.
How would you create 2 eval_genome functions that can take in the same observation real-time? This means that they train based off of the same images and environmenrs.
Help?

I'm not sure how to do this as I haven't played with neat-python before but I'm honestly curious, why do you want to do this? To compare the resulting network structures or something else?

I am planning to study the interactions between agents trained together. I want to see if they can develop cooperative behavior. This problem with neat is annoying though...

Does anyone know how to solve this

I'm not familiar with neat-python, but I have implemented NEAT to do openai tasks. If there is a class for initializing a population, you could just use that and have 2 objects like population1 and population2 and call them in the same loop.

well if you want to just train genomeN against genomeN-1 then you just need to loop through genomes using indexing and start at 1 so you can always do genome1 = genomes[ix-1] and genome2 = genomes[ix] and then modify your fitness evaluation code to run both at the same time and applies a fitness function to each. Also maybe you iterate by twos so that you only eval each net once.


text:
What is graph clustering?
There are several (family of) algorithms that can be used to cluster a set of $d$-dimensional points: for example, k-means, k-medoids, hierarchical clustering (agglomerative or divisive).
What is graph-based clustering? Are we clustering the nodes or edges of a graph instead of a set of $d$-dimensional (as e.g. in k-means)? Couldn't we just use k-means to also cluster a set of nodes?

Not to be confused with clustering multiple different graphs based on e.g. their edit distance or geometric properties, as in http://www.eurocg2019.uu.nl/papers/45.pdf

@Discretelizard Yes, this is also noted in the paper I mentioned in my answer (maybe I should have pointed this out in my answer).

In addition to the methods mentioned by nbro for clustering the nodes of a graph,"spectral clustering" for non-graph data conceptually proceeds by assembling a graph the nodes of which are the data points. It then uses the highest-eigenvalue eigenvectors of a diffusion operator on thisgraph to assign nodes to clusters. For data that is already in graph form, a procedure that skips the first part might be of interest.

In graph clustering, we want to cluster the nodes of a given graph, such that nodes in the same cluster are highly connected (by edges) and nodes in different clusters are poorly or not connected at all.
A simple (hierarchical and divisive) algorithm to perform clustering on a graph is based on first finding the minimum spanning tree of the graph (using e.g. Kruskal's algorithm), $T$. It then proceeds in iterations. At each iteration, we remove from $T$ the edge with the highest weight. Given that $T$ is a tree, the removal of an edge from $T$ will create a forest (with connected components). So, after the removal of the edge of highest weight from $T$, we will have two connected components. These two connected components will represent two clusters. So, after one iteration, we will have two clusters. At the next iteration, we remove the edge with the second highest weight, and this will create other connected components, and so on, until, possibly, all nodes are in their own cluster (that is, all edges have been removed from $T$).
There are several limitations of this algorithm. For example, it only considers the edges of the initial graph that are shared with $T$ (that is, it only considers the edges of the minimum spanning tree). It also requires the edges of the graph to be weighted. It does not require the number of clusters to be known in advance (like any other hierarchical clustering algorithm), but we still need to choose the optimal number of clusters (after the algorithm has terminated). We can do that in several ways. A way to do it would be to have a threshold value $t$ that is used to decide when we should stop removing edges from $T$: more specifically, we will keep removing edges from $T$ until the next highest weight is higher than this threshold $t$.
There are numerous applications of this type of clustering. For example, we might want to discover certain groups of people in social networks.
The paper Graph clustering (by Satu Elisa Schaeffer, 2007) provides a readable and quite detailed overview of this field.
There are algorithms based on k-means that can also work on graphs. See e.g. Graph-based k-means Clustering: A Comparison of the Set Median versus the Generalized Median Graph (by Ferrer et al.).


text:
Hinton's reading list from the removed Coursera MOOC
Geoffrey Hinton's Coursera MOOC was recently discontinued:
https://twitter.com/geoffreyhinton/status/1085325734044991489?lang=en
The videos however are still available at both on Youtube and on Hinton's webpage:
https://www.cs.toronto.edu/~hinton/coursera_lectures.html
However in his MOOC Hinton also had some papers as required (or recommended, I can't really remember) readings after each lecture. They were generally old, seminal papers which provided some good insights and intuitions and were worth reading IMHO for learning purposes. I couldn't find these papers as a reading list online. Does anyone have this list?


text:
What Model Used for Forecasting Sales with Dynamic Holiday
I'm working on a project where I need to forecast sales data where I have history of 1 year (2017) daily data. I am new on Artificial Intelligence topic and after searching for a while, I think ARIMA or Multiple Linear Regression is a good model for seasonal forecasting (Correct Me If I'm Wrong). But then I think that my history data is exclusive for 2017 because on 2018 and 2019, holiday date is changing.
What model I have to used to forecast based on new holiday setup? Is ARIMA or Multiple Linear Regression still can be used? Or I need another model? Where do I have to start on this?


text:
What are the purposes of autoencoders?
Autoencoders are neural networks that learn a compressed representation of the input in order to later reconstruct it, so they can be used for dimensionality reduction. They are composed of an encoder and a decoder (which can be separate neural networks). Dimensionality reduction can be useful in order to deal with or attenuate the issues related to the curse of dimensionality, where data becomes sparse and it is more difficult to obtain "statistical significance". So, autoencoders (and algorithms like PCA) can be used to deal with the curse of dimensionality.
Why do we care about dimensionality reduction specifically using autoencoders? Why can't we simply use PCA, if the purpose is dimensionality reduction?
Why do we need to decompress the latent representation of the input if we just want to perform dimensionality reduction, or why do we need the decoder part in an autoencoder? What are the use cases? In general, why do we need to compress the input to later decompress it? Wouldn't it be better to just use the original input (to start with)?

It is important to think about what sort of patterns in the data are being represented.
Suppose that you have a dataset of greyscale images, such that every image is a uniform intensity. As a human brain you'd realise that every element in this dataset can be described in terms of a single numeric parameter, which is that intensity value. This is something that PCA would work fine for, because each of the dimensions (we can think of each pixel as a different dimension) is perfectly linearly correlated.
Suppose instead that you have a dataset of black and white 128x128px bitmap images of centred circles. As a human brain you'd quickly realise that every element in this dataset can be fully described by a single numeric parameter, which is the radius of the circle. That is a very impressive level of reduction from 16384 binary dimensions, and perhaps more importantly it's a semantically meaningful property of the data. However, PCA probably won't be able to find that pattern.
Your question was "Why can't we simply use PCA, if the purpose is dimensionality reduction?" The simple answer is that PCA is the simplest tool for dimensionality reduction, but it can miss a lot of relationships that more powerful techniques such as autoencoders might find.

A use case of autoencoders (in particular, of the decoder or generative model of the autoencoder) is to denoise the input. This type of autoencoders, called denoising autoencoders, take a partially corrupted input and they attempt to reconstruct the corresponding uncorrupted input. There are several applications of this model. For example, if you had a corrupted image, you could potentially recover the uncorrupted one using a denoising autoencoder.
Autoencoders and PCA are related:

an autoencoder with a single fully-connected hidden layer, a linear activation function and a squared error cost function trains weights that span the same subspace as the one spanned by the principal component loading vectors, but that they are not identical to the loading vectors.

For more info, have a look at the paper From Principal Subspaces to Principal Components with Linear Autoencoders (2018), by Elad Plaut. See also this answer, which also explains the relation between PCA and autoencoders.

PCA is a linear method that creates a transformation that is capable of changing the vectors projections (changing axis)
Since PCA looks for the direction of maximum variance it usually have high discriminativity BUT it does not guaranteed that the direction of most variance is the direction of most discriminativity.
LDA is a linear method that creates a transformation that is capable of finding the direction that is most relevant to decide if a vector belong to class A or B.
PCA and LDA have non-linear Kernel versions that might overcome their linear limitations.
Autoencoders can perform dimensionality reduction with other kinds of loss function, can be non-linear and might perform better than PCA and LDA for a lot of cases.
There is probably no best machine learning algorithm to do anything, sometimes Deep Learning and Neural Nets are overkill for simple problems and PCA and LDA might be tried before other, more complex, dimensionality reductions.

What does LDA have to do with question?

LDA can be used as dimensionality reduction. The original algorithm derives only one projection but you can use it to get lower ranking discriminative direction for more acurate modelling

PCA does not guarantee maximum variance either, since it is a greedy algorithm it only approximates the maximum.

PCA has a closed solution, the main axis will always be de direction of maximum variance. It is not a greedy algorithm (but it can be implemented as one)

The decoder half is necessary in order to compute the loss function for training the network. Similar to how the 'adversary' is still necessary in a GAN even if you are only interested in the generative component.
Autoencoders can learn non-linear embeddings of the data, and hence are more powerful than vanilla PCA.
Autoencoders have applications beyond dimensionality reduction:

Generating new data points, or perform interpolation (see VAE's)
Create denoising filters (e.g. in image processing)
Compress/decompress data
Link prediction (e.g. in drug discovery)


text:
Are there existing examples of using neural networks for static code analysis?
Background Context:
In the past I've heavily applied various "code quality metrics" to statically analyze code to provide an inkling of how "maintainable" it is and using things like the Maintainability Index alluded to here.
However, a problem that I face is whether a language has libraries that effectively measure such metrics - only then is it usable else it's rather subjective/arbitrary. Given the plethora of languages that one has to deal with in an enterprise system, this is can get rather unwieldy.
Proposed Idea:
Build and train an Artificial Neural Network that "ingests a folder of code" (i.e., all files within that folder/package are assumed to house the "project" whose quality metrics we'd like to compute). This may again be language dependent but let's assume it exists for a language that I'm having the hardest time with (for measuring "maintainability"): Scala.
Using numeric metrics like McCabe's complexity or Cyclomatic complexity maybe "convention" but are not entirely relevant. Few things like class/method length are almost always relevant no matter the language. Thus, providing a few "numeric metrics" + abstract notion of readability by subjective evaluation to train an ANN would be a good balance of "inputs" to the ANN. The output being either a classification of maintainability like low, medium, high etc., or a number between 0 and 1.
Question:
Has this been tried and are there any references? I spent some time digging via Google Scholar but didn't find anything "usable" or worthwhile. It's okay if it's not Scala, but have ANNs been used for measuring code quality (i.e., static analysis) and what are the benefits or disadvantages of something like this?
PS: Hopefully, the question isn't too broad, but if so, please let me know in the comments and I'll try make it as specific as possible.

There's certainly literature on a related topic: code smell detection.
A "code smell" is a sign that code has a maintenance problem, and hints at the presence of technical debt. It is reasonable to suppose that code with a lot of smells is lower quality. Code smells include things like giant classes, high cyclomatic complexity, and more.
Fontana et al. have a good 2016 survey comparing different ML methods for detecting code smells. A reverse citation search on that paper uncovers many other papers that seem relevant, including:

Rasool et al. 2015, A review of code smell mining techniques
da Silva Maldonado et al. 2017 Using Natural Language Processing to Automatically Detect Self-Admitted Technical Debt
Maneerat & Muenchaisri, 2011, Bad-smell prediction from software design model using machine learning techniques
Mansoor et al. 2017, Multi-objective code-smells detection using good and bad design examples

This seems like a pretty well-studied area. I wasn't able to find a cross-language model though, but I suspect one may well exist.

Code smells are quite different from maintainability as a whole. Just another dimension. At times, one may let the smell be and not impact maintainability.

@PhD That is true. Is something like this closer to what you are looking for? https://ieeexplore.ieee.org/abstract/document/285855

Interesting abstract. Will have to read up a bit to know how/what. Will keep you posted :)


text:
Do we need to reset the DQN network after every episode?
I was going through this implementation of Reinforcement learning where model is being trained to manage the number of bikes at a station.
Here, line 78 represents the loop over all episodes (if I understood correctly). In line 92, the DQN Agent is defined meaning after each episode, the agent will be reset to default parameters.
But shouldn't we define the model before the loop starts because the after each episode, won't all the previous learning be lost if we initialize the class object in each iteration?
Am I misinterpreting anything?

Code doesn't look correct to me.  DQN  shouldn't be reinitialized every episode (there could be exception for special methods with random search but that is not the case there)

I thought the same. But since all the results are included with visualizations which shows that model actually worked, I am in doubt what could this mean.

They are not resetting the agent after every episode, that would be ridiculous, the variable called 'episodes' is clumsily chosen, it is a list of episodes that will be performed in a single training session and size of that list is number of training sessions they will perform. The real training is going on when they call train_operator method  on line 98, they pass number of episodes there.

Now I understand. But do we reset the agent after every session? What happens to the previous session learning?


text:
Live video object detection with pose estimation
I was researching about hierarchical object detection, and end up reading that Yolo v3 is the state of art for that kind of tasks, besides, the inference time make it one of the best for run it on live video.
So, what I have in mind, is to run a pose estimation technology over the live video (LikeOpenPose), then focus only in the rectangles near the hands of the estimated pose in order to detect the object.
the previous approach sounds good, but I feel like I'm not taking advantage of the temporal features on the video, for example, YoloV3 could not be very sure that someone has a cellphone with only the rectangle of the hands, but if I add up, the movement of the estimated pose (hand near to the head for several frames), I could be more sure that he has a phone.
But I cannot find a paper, approach or something close to the idea I have on mind, so I was wondering if someone here could give me a little clue about what path should I follow.
Thanks in advance for any help!


text:
How to build a DQN agent which can be trained through interactive learning?
I am trying to create a chatbot whose dialogue policy model will be trained through reinforcement learning. Dialogue Policy is responsible for selecting the action to take based on the given state of the conversation.
All implementations I see for RL are trained from an environment taken from Gym or created manually. These environments provide the next state, rewards etc to the model based on which it is trained.
Since I am creating a dialogue policy model which will be trained through real user conversations, I cannot provide a "pre-defined" environment which can provide the states and rewards. I am planning to train it myself by talking to it and providing rewards and next state (which I think is called interactive learning).
But I was not able to find any implementations, tutorials or articles on interactive learning. I am not able to figure out how to create such a model, how to take care of the episodes, sessions etc. This will be a continuous learning that will go on for months maybe. I have to save the model each day and continue training the next day by loading the model from that same state.
Can anyone guide me in the correct direction on how to approach this? Any githubs links, articles, tutorials of such implementations will be highly appreciated. I am aware this question seems too broad, but some hints will be very helpful for a newbie like me.

I suggest you to start reading this one on BERT and this one on GPT-2.

I am aware this question seems too broad, but some hints will be very helpful for a newbie like me.

I'm not sure you want to create your chatbot using RL architecture at all. But if you want to implement such an idea the right way to go with that is by using iterative approach and starting from a really simple base:

Define a list of actions for your agent. Might be 10-words
vocabulary with simple one-word answers.
Define you simple environment. It might have 20 different states (e.g. greetings/conversation starters hey, hello)
Map good responses (hello -> hi) to positive rewards and -1 for the rest of them.
If you want to move forward with DQN try a simple Q-learning algorithm on your simple environment and train agent to properly response to those.
Once you have done the above you can make your vocabulary bigger
Now replace your table of input words which gives you a state for your network with NN/word2vec/any other NLP approach which will convert your input sentence to a state.
Manually provide a reward as a response for what you agent did according to learned policy.
Do that infinite amount of time and your agent probably will figure out how to respond properly.

NOTE: DQN uses discrete action space. So in such a case you will have only limited or REALLY HUGE actions space. It's all possible combinations between all possible words in you vocabulary (assuming action maps to some sentence)

Thank you for a proper explanation. This definitely makes things clearer. Do you know of any implementations of such an approach in which directly the user trains the model?

@mayankagrawal I guess you need to at least be familiar with some base approaches, so https://www.nltk.org/book/ is a good place to start. If you want to go right away to implementing - use https://www.tensorflow.org/tutorials/sequences/text_generation or https://www.tensorflow.org/tutorials/keras/basic_text_classification to understand how text is represented with a model.


text:
Is there a way to compare the similarities among different graphs and then cluster them using Unsupervised learning?
I have a dataset about (240000,23). For my task, I have to use an unsupervised learning method and apply it on every single column separately in order to detect anomalies that might exist. I have pre-processed the data and I am visualizing the TimeElapsed vs the parameter in Python (The graphs look like the one shown in an earlier post by me here).
I am wondering if there is a way wherein after the graphs are plotted, the graphs are compared with each other and then clustered together based on their similarities.
Example: If I have temporal data of about 200 products, I plot the graphs of all the 200 products (as can be seen in the link provided above) and these 200 graphs must be compared with each other and must be separately plotted as 200 different points on a scatter plot (by using some unsupervised learning techniques) based on how similar are the graphs of different products to each other.
I don't know if the code that I have would be helpful in guiding me, but the code that I have is here:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1234)

dataset = pd.read_csv('Temporal_DataTable.CSV', header = 0)
dataset != 0
(dataset != 0).any(axis=0)
dataset = dataset.loc[:, (dataset != 0).any(axis=0)]

dataset['product_number'] = pd.factorize(dataset.Context)[0]+1
dataset['index'] = pd.factorize(dataset.Context)[0]+1

cols = list(dataset.columns.values)
cols.pop(cols.index('StepID'))
cols.pop(cols.index('Context'))
cols.pop(cols.index('product_number'))
cols.pop(cols.index('index'))
dataset = dataset[['index','product_number','Context','StepID']+cols]
dataset = dataset.set_index('index')

max_time_ID_without_drop = dataset.groupby(['product_number'])['TimeElapsed', 'StepID'].max()
avg_time_without_drop = np.average(max_time_ID_without_drop['TimeElapsed'])

dataset_drop = dataset.drop(index = [128, 133, 140, 143, 199])

max_time_ID_with_drop = dataset_drop.groupby(['product_number'])['TimeElapsed', 'StepID'].max()
avg_time_with_drop = np.average(max_time_ID_with_drop['TimeElapsed'])

dataset = dataset.drop(columns=['TimeStamp'])
dataset_drop = dataset_drop.drop(columns=['TimeStamp'])

grouped = dataset.groupby('product_number')
ncols = 4
nrows = int(np.ceil(grouped.ngroups/40))
for i in range(10):
    fig, axes = plt.subplots(figsize=(12,4), nrows = nrows, ncols = ncols)
    for (key, ax) in zip(grouped.groups.keys(), axes.flatten()):
        grouped.get_group((20*i)+key).plot(x='TimeElapsed', y=['Flow_Ar-EDGE'], ax=ax, sharex = True, sharey = True)
        ax.set_title('product_number=%d'%((20*i)+key))
        ax.get_legend().remove()
        handles, labels = ax.get_legend_handles_labels()
        fig.legend(handles, labels, loc='upper center')
plt.show()

Thanks in advance for the help.

Do you have the vectors x,y that describe those graphs? you can perform clustering at y vector (if x ocuppies the same time period and in the same density/sampling rate in all graphs).


text:
Is there any formal test for linear separability of 2-class data?
SVM is designed for two-class classification problem. If the data is not linear-separable, a kernel function is used. I want to know  if there is exists any method that will indicate if the data is linearly separable or not.


text:
One dimension deconvolutions or fully connected layers?
I’ve created a variational autoencoder to encode 1-dimensional arrays. The encoding is done through 3 1d-convolutional layers. Then, after the sampling trick, I reconstruct the series using 3 fully connected layers. Here are my questions in case some can shed some light on it:
I think it would be better if I use 1d-deconvolutional layers instead of fully connected, but I cannot understand precisely why.

It’s because it would bring better results? But then, if the FC layer is complex enough should be able to archive the same results, right?
It’s because would be more efficient? This is, would get the same results as a complex enough FC layer but with less training and parameters?
Or it’s because of other reasons that I’m missing.

Thanks.


text:
Image-Specific Class Saliency Visualisation
In the paper "Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps", https://arxiv.org/abs/1312.6034, at part 3, there is a first-order Taylor expansion(formula number 3 & 4) that I can't understand the logic behind it and how they are obtained.
Those formulas are about computing saliency map in convolutional neural networks.


text:
Multi-field text input for LSTM
I'm using LSTM to categorize medium-sized pieces of text. Each item to be categorized has several free-form text fields, in addition to several categorical fields. What is the best approach to using all this information for categorization?  I see two options:

Concatenate the text from all fields, preceding each field content with a special token. Run concatenated text through LSTM.
Train one model per field. Concatenate output from each model in a hidden layer and pass into subsequent layers.

What are the benefits of each of the approaches? Is there an alternative I'm missing?

Could you give an example of data for both. Have you proceeded and have some results at all?


text:
Is there a reason evolutionary algorithms are language-bound in research material?
I've been working on genetic algorithms & evolutionary strategies for a while now in a research context. Across the vast majority of the articles and content I've read, every single one of them will either use Python, Matlab, or Java/C++ to build & benchmark their algorithms.
Is there an objective reason for these languages to be the single ones used in a research environment? Mainly in contrast with other languages like C#, or Javascript, that are almost never used (despite being some of the most used programming languages in other areas), whereas it would definitely be possible to code in practice all current algorithms in them.

It is going to be very hard to answer this without some kind of poll or insider knowledge across all major published researchers. Whilst the most likely simple answer is likely that it is down to a few initial preferences, followed by no compelling reason to change.

I would say there are quite a few different reasons for this, with the proportion of each dependent on a given researcher.
For example, I use python for the vast majority of what I do. And for me, it is due to a few different factors:

I was already familiar with python, and it is a simple, high-level abstraction. This is probably the reason a lot of people set it and forget it, particularly with python. It allows them to focus on the ideas and implementation of said ideas, without worrying about all the junk that comes with trying to write a program in a faster language like C++
The vast majority of ML/DS packages are only or primarily supported via python. I think this is probably the main reason for most in the field, as even if one can implement the architecture in a faster language, the time to do so would likely even out when taking into account the time required to prototype a given model. Tensorflow and others are supported for other languages but do not see the same level of dev support.
The ability to deploy models to multiple platforms without headache. When working in an environment where the work is also applied, the ability to deploy a given model without too much debugging cannot be understated.

These are just a few of the main ones, and as I said the reasons for a particular language over another is primarily a preferential one, and can even vary by requirements(i.e speed)


text:
Combining deep reinforcement learning with alpha-beta pruning
I will explain my question in relation to chess, but it should be relevant for other games as well:
In short terms: Is it possible to combine the techniques used by AlphaZero with those used by, say, Stockfish? And if so, has it been attempted?
I have only a brief knowledge about how AlphaZero works, but from what I've understood, it basically takes the board state as input to a neural net, possibly combined with monte carlo methods, and outputs a board evaluation or prefered move. To me, this really resembles the heuristic function used by traditional chess engines like stockfish.
So, from this I will conclude (correct me if I'm wrong) that AlphaZero evaluates the current position, but uses a very powerful heuristic. Stockfish on the other hand searches through lots of positions from the current one first, and then uses a less powerful heuristic when a certain depth is reached.
Is it therefore possible to combine these approaches by first using alpha-beta pruning, and then using AlphaZero as some kind of heuristic when the max depth is reached? To me it seems like this would be better than just evaluating the current position like (I think) AlphaZero does. Will it take too much time to evaluate? Or is it something I have misunderstood? If it's possible, has anyone attempted it?

Yes it's possible to to combine AlphaZero with Minimax methods (including alpha-beta pruning). AlphaZero itself is combination of  Monte Carlo Tree Search (MCTS) and Deep Network, where MCTS is used to get data to train network and network used for tree leafs evaluation (instead of rollout as in classical MCTS). It's possible to combine selection-expansion part of AlphaZero MCTS with Minimax the same way as it was done for classical MCTS - "Monte-Carlo Tree Search and Minimax Hybrids", pdf.

So, from this I will conclude (correct me if I'm wrong) that AlphaZero
  evaluates the current position, but uses a very powerful heuristic.
  Stockfish on the other hand searches through lots of positions from
  the current one first, and then uses a less powerful heuristic when a
  certain depth is reached.

This is wrong. Like Stockfish, AlphaZero as well "searches through lots of positions from the current one." You hint at this yourself when you say "possibly combined with monte carlo methods", but it seems you don't understand exactly what that means, so let me explain:
Stockfish searches through the tree of future moves using an algorithm called Minimax (actually a variant called alpha beta pruning), whereas AlphaZero searches through future moves using a different algorithm called Monte Carlo Tree Search (MCTS). Minimax is well suited to quick evaluation functions, whereas MCTS explores fewer moves and thus can handle a more expensive evaluation function. Further, MCTS works not with exact values but with probabilities, and AlphaZero uses the Neural Net not just for the value of moves but to guide which moves to explore next (it functionally is actually 2 networks, a policy network and a value network).
To be sure, that is somewhat of a simplification. It is not impossible to use a NeuralNet in conjunction with Minimax. Its just that in practice, due to the nature of the algorithm, its simply too expensive.

AlphaZero is not using NN in tree policy but only for evaluation of leafs: https://github.com/suragnair/alpha-zero-general/blob/master/MCTS.py

@mirror2image that link is to some personal implementation. It may be I confused it will alpha go I'll check the paper

AlphaGo uses MCTS.  AlphaZero does not.
Source: Mastering the Game of Go without Human Knowledge

Welcome to SE:AI!  This answer would be stronger if you quoted the relevant passages from the paper.

Alphazero certainly uses MCTS.     https://arxiv.org/pdf/1712.01815      Page 3 line 4,5 . However, it uses a modified form of MCTS (no rollouts, etc)


text:
What methods are there to generate artificial training examples based on existing training examples?
I have a small dataset (117 training examples) and many features (4005). Each of the training examples is binary labeled (healthy / diseased). Each feature represents the connectivity between two different brain regions.
The goal is to assign subjects to one of the two groups based on their brain activity.
What methods are there for generating new artificial training examples based on the existing training examples?
An example I could think of would be SMOTE. However, this technique is usually only used to balance unbalanced datasets. This would not be necessary for my set, since it has about the same number of training examples for both label classes.

Whilst you can definitely create a generative model, this is not a way to improve performance of a classifier. That's the data science equivalent of the cartoon where a character stands on a sail boat and blows into the sail to make it go faster. Could you clarify what you want to use the examples for?

I would like to use the artificial training examples as additional examples to train an SVM. Haha, thanks for that metaphor!

I'm pretty sure data augmentation is only possible when you have some idea of what the underlying data distribution is. Image datasets, for example, can be augmented with rotations. This works because we intuitively know that the set of natural images is generally closed under rotation. Do you have any prior knowledge about your data that would enable you to make some assumptions about their distribution?


text:
Understanding average precision (AP) in measuring object detector performance
I am trying to understand the average precision (AP) metrics in evaluating the performance of deep-learning based object detection models. Suppose we have the following ground true (four objects highlighted by four blue arrows):

where we have labelled four objects:
person 25 16 38 56
person 129 123 41 62
kite 45 16 38 56
kite 169 123 41 62

And when feeding the above image to an object detector, it gives the following outputs:

It's easy to see that the object detector identified another object with low confidence:
person 0.4 25 16 38 56
person 0.2 129 123 41 62
kite 0.3 45 16 38 56
kite 0.5 169 123 41 62
kite 0.1 769 823 141 162 <-------- a "kite"

In my humble opinion, this is an erroneous behavior of the object detector, which should be counted as a "false positive".
However, since the "kite" has a quite low confidence score (0.1), when using the standard mAP algorithm to compute the performance, I got the following output (I am using code from here to compute the mAP):
AP: 100.00% (kite)
AP: 100.00% (person)
mAP: 100.00%

So here are my questions and confusions:

from what kind of design intension, the AP is designed in a way such that objects with low confidence score are ignored and therefore in this case we are with flying colors.
Is there any metrics that can take this extra "kite" into consideration and therefore would output one "false positive" of the object detection model? I am just thinking that in this way, we can further proceed to improve the accuracy of this model during training.


text:
Why aren't compiled languages as popular as Python in AI?
One of if not the most popular programming language for data science and AI today is Python, with R being a frequently cited runner-up. However, both of them are interpreted languages, which do not execute as fast as compiled languages. Why is that the case? The main advantage of AI over humans is in computing speed, and with real world AI applications today handling big data, execution time will already increase considerably as it is. Why aren't compiled languages preferred for this very reason?
Sure, the key argument and strength going for Python is its vast range of third party libraries available for AI, like scikit etc. but such communities can take root and grow anywhere under the right circumstances. Why did this community end up growing around Python and not a faster, equally common compiled language like C++, C# or Java?

This question is highly related to https://ai.stackexchange.com/q/3494/2444 and https://ai.stackexchange.com/q/7205/2444. Maybe they are all duplicates.

I know that some companies prototype several solutions in Python and then translate the best one in Java.

There are a few advantages of interpreted languages (compared to compiled languages)

platform independence (you only need the interpreter for your platform, even though this is not true if e.g. your interpreted language is only a wrapper library around a library written in another programming language)
dynamic typing (no need to specify the types of the variables)
dynamic scoping (e.g. you can access variables in other scopes)
automatic memory management (but there are compiled languages, like Java, that also have a garbage collector)
Rapid prototyping (for various reasons, including dynamic typing), hence software can be written more quickly

Hence, the main advantages of an interpreted language compared to a compiled language are flexibility and dynamism. Given that AI is still an evolving field, these characteristics are widely appreciated.
There is also at least one disadvantage of interpreted languages (compared to compiled languages)

Slower running times compared to compiled languages, which, once compiled, are quite fast, because they are often compiled to a code that is quickly executable by the machine or virtual machine

Python and R are widely used in data science and artificial intelligence because of the advantages above, which possibly contributed to the rapid growth of the communities around them and the development of software libraries.
However, note that the core of the most common machine learning libraries today, including TensorFlow and PyTorch, is written in a compiled language like C and C++. In the specific case of TensorFlow, Python is just a wrapper library. Consequently, under the hood, the code is not executed by the Python interpreter, but first compiled, which implies that, when you're using e.g. TensorFlow, your code will run (more or less) as fast as if you were using a compiled language like C. A similar argument can be made for libraries like NumPy, where Python is just a wrapper library.

is there any good reason why python may not be compiled to be as fast as C?

@user8426627 Python code can be first compiled to an intermediate code (called bytecode). See e.g. https://stackoverflow.com/q/471191/3924118. So, Python is both a compiled and interpreted language (like Java). There's also a version of Python that is only compiled Cython, which should give you C-like performance, but this is not the official distribution of Python. If you decide that you want a compiled language, then the language might lose flexibility in certain aspects, because you want to optimize towards the specific architecture (or OS).


text:
What are the benefits of using the state information that maintains the graph structure?
When you applying a graph structured data to the graph convolution network,  what are the benefits of using the state information that maintains the graph structure?

By state information, do you mean the vector representing the state of each node and, possibly, the vector representing the whole graph?

@nbro yes, the vector representing the state of such nodes information

Is there any specific GDL architecture you're referring to?

@nbro I recently read https://arxiv.org/abs/1611.08402. Although the method is compared with various GCNs methods, the method presented in this (MoNet) paper is very good. Is this because you are able to use such information better than other methods?

It is difficult to explain the exact reason behind the better results of MoNet w.r.t. some previous models. They use some learnable parameters, rather than handcrafting them, and they say that MoNet generalises other previous works. This might affect the performance of the model. Regarding your original question, I can try to provide an answer, but I am not sure my answer will address your issue. It's just my interpretation.


text:
What parameters can be tweaked to avoid a generator or discriminator loss collapsing to zero when training a DC-GAN?
Sometimes when I am training a DC-GAN on an image dataset, similar to the DC-GAN PyTorch example (https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html), either the Generator or Discriminator will get stuck in a large value while the other goes to zero. How should I interpret what is going on right after iteration 1500 in the example loss function image shown below ? Is this an example of mode collapse? Any recommendations for how to make the training more stable? I have tried reducing the learning rate of the Adam optimizer with varying degrees of success. Thanks!

GANs are notably hard to train and it is not uncommon to have large bumps in the losses. The learning rate is a good start but the instability may come from a wide variety of reasons. I'm assuming that you have no bug in your code or data.
For one, gradient descent is not well suited to the 2-player game we're playing. I've personally found ExtraAdam to yield much more stable training (code, paper).
It could also come from the loss and many tricks have been developed and one of the most popular one is enforcing smoothness in the gradient (see W-GAN, W-GAN-GP etc.). SpectralNorm (code paper) is a very popular and recent normalization technique for the discriminator.
There are a number of additional tricks to make GANs work like label smoothing and flipping, different update rates for the discriminator and generators (as in BigGAN for instance). I suggest you have a look at this nice repo of (somewhat seasoned) tricks: ganhacks.


text:
Predicting Hot Categories In a Reference Manager
Reference managers like Zotero or Mendeley allow researchers to categorize papers into hierarchical categories called collections. The User navigates through a listing of these collections when filing a new item. The retrieval time grows something like the logarithm of the number of collections; looking for a collection can quickly become a nuisance.

 Fig 1. A top level list of collections in the Zotero reference manager
One way to reduce navigation time is to allow users to search collections by name. A complementary solution is to provide a view of the currently "hot" collections. The user may interact with a list of suggested collections, or receive relevant completions when typing into a collections search bar.
This raises a basic learning problem:

Let $K = K_1, \ \dots, \ K_m$ be the sequence of collections the user has visited (possibly augmented with visit times). Let $H_m$ be a set of $n$ collections the user is likely to visit next. How can we construct $H_m$?

A technique that does this this might exploit a few important features of this domain:

Project Clusters: Users jump between collections relevant to their current projects
Collection Aging: Users tend to focus on new collections, and forget older ones
Retrieval Cost: There's a tangible cost to the user (time, distraction) when navigating collections; this applies to the reduced view (the technique might keep $n$ as small as possible)

Two ideas so far
LIFO Cache

Reduce $K_{m-1}, K_{m-2},\ \dots$ into the first $n$ unique entries which do not match $K_m$.

This heuristic is very simple to implement and requires no learning. It encompasses clusters and aging given suitably large $n$. But with large $n$ it incurs a retrieval cost of its own.
Markov Chain/Hidden Markov Model

Use $K$ to train a MC or HMM. Build $H_m$ using estimates from this model.

The simplest version is an order $k\ $ MC transition matrix built using k-gram statistics of $K_i$. This might be sensitive to project clusters, but I don't think it will recognize new collections without a hard coded aging heuristic.
I'm not clear on how HMMs would be trained here, and I'm not very taken with the $k$-gram MC approach. My next task is to read about MCs/HMMs in context of suggestion systems.
Other Models
I am brand new to suggestion systems. Reading leads are quite welcome!
I would be especially excited about unsupervised techniques, and neural network techniques I could train on a GPU. Apart from improving Zotero, I would like this problem to give me an opportunity to learn about cutting edge techniques.
Valuable Goals
An ideal technique would cast light on questions like

How should we measure the performance of this kind of system? (I suspect cache miss rate is a good metric, as well as the ratio between cache miss rate and cache size)
How should we translate these human-centric performance metrics into human independent objective functions for learning?
How much better than LIFO can we theoretically expect to do with a more sophisticated technique (say, in terms of cache size for a given cache miss rate)?
How can a technique learn patterns like clusters and aging without hand tuned objectives?

I am interested in learning theory and building an implementation, so resources with publicly available code would be be preferable. Apart from potentially being overkill for the problem, I would not mind if the final model depends on a GPU.
Please forgive me for the long and vague question. I wish I had done more reading before posing this question, but I feel a bit stuck! I hope to get unstuck with some good reading resources. Thanks!


text:
Reducing the Number of Training Samples for collaborative filtering in recommender systems
I have the following problem: I am doing some research on the accuracy of recommender algorithms that are mostly used nowadays.
So, one way to measure their performance is by checking how well they predict a certain value under different sizes of a given dataset, meaning, sparsity in a ratings matrix.
I need to find a way to calculate the root mean square error(or mae), some metric, versus the sparsity in the dataset. As an example, let’s have a look at the picture below:

You can see that it says:

“RMSE as a function of sparsity. 5000 ratings were removed from the training set(initially containing 80000 ratings) in every iteration. “

I’m using Python and the Movielens dataset. Do you know how can I achieve this in the mentioned language? Is there any tool to do that?


text:
How can I train a neural network to give probability of a random event?
Let's say I have an adjustable loaded die, and I want to train a neural network to give me the probability of each face, depending on the settings of the loaded die.
I can't mesure its performance on individual die roll, since it does not give me a probability.
I could batch a lot of roll to calculate a probability and use this batch as an individual test case, but my problem does not allow this (let's say the settings are complex and randomized between each roll).
I have 2 ideas:

train it as a classification problem which output confidence, and hope that the confidence will reflect the actual probability. Sometimes the network would output the correct probability and fail the test, but on average it would tend to the correct probability. However it may require a lot of training and data.
batch random rolls together and compare the mean/median/standard deviation of the measured result vs the predictions. It could work but I don't know the good batch size.

Thank you.

@DuttaA while a function cannot predict a random ouput, It could theorically predict probabilities, which are not random. either I need to built test cases by grouping individual entries into a statistical distribution, or find another clever method.

The starting point is that for a fair dice thrown fairly the p(n) is 1/n where n is the number of sides.
You said both
and

there are too many variables (up 40 dimensions with value range 1-100) in input, I don't know how these properties relate and an empirical approach would require too much data.

It seems that this problem has 2 solutions:

Don't use a neural net and create a 'std' statistical model.
It may be possible since you said:

I know there is some underlying rule that simplify a lot the problem (ie. reduce the actual number of dimension of the input)

Use a neural network (with softmax at the end) - for a fair dice; with enough training data the classifier should arrive as 1/n as the approximating function for a fair dice. The other 40 dimensions/settings your mentioned are the inputs. I think a 'basic' neural network with dense layers only could work for your task.

Neural network isnt what you want here. You have a limited number of events and draws from some unknown distribution that you want to recover.
In that case, just use the empirical probabilities $p(event_i) = \frac{\# event_i}{total\ events}$ which given enough draws will converge to the true probability.

I'm not sure I can do that because there are too many variables (up 40 dimensions with value range 1-100) in input, I don't know how these properties relate and an empirical approach would require too much data. But it could be a valid approach if I make some assumptions on the model to simplify it.

If you cannot take an empirical approach how will you generate training data for your ML algorithm?

This approach:

train it as a classification problem which output confidence, and hope that the confidence will reflect the actual probability. Sometimes the network would output the correct probability and fail the test, but on average it would tend to the correct probability.

will work with some limitations. If you use a classifier with softmax activation and multiclass log loss
$$\mathcal{L}(\mathbf{\hat{y}},\mathbf{y}) = -\mathbf{y} \cdot  \text{log}(\mathbf{\hat{y}})$$
where $\mathbf{\hat{y}}$ is the network output as a vector, and $\mathbf{y}$ is the actual output from an individual sample. Your input should be the settings of the die.
Optimising this loss will converge on approximated probabilities for each discrete output. You can demonstrate this with some simple examples - for instance if you train a network with a single input - a one-hot-encoded die type from the classic D&D dice sets, plus deliberately chosen examples of different results in the right frequencies, you will end up with a classifier that predicts roughly $p=0.25$ for results of 1,2,3,4 for a d4 and $p=0.125$ for results of 1,2,3,4,5,6,7,8 for a d8
So it works mathematically. Whether it works for your situation depends on details. You need enough data samples to cover both the distribution of results under each setting, and any complexities of how that distribution varies with the settings. In the limit of wanting very accurate predictions of probability within a complex space you will need a huge number of samples. You should be able to find a compromise between accuracy and generalisation by trying different levels of regularisation - this will be necessary as over-fitting to input/output sample pairs as seen is going to be a serious problem for a neural network trained on this data.
One thing you can do to help a classifier learn probabilities is always take some number of samples with the same settings - e.g. 10 or 100 or 1000 each with the same settings - that should guarantee that the network cannot simply converge to predict high $p$ values for single outputs as seen, as it will have counter-examples to work with.
You mention that you have 40 dimensions of settings. Whether this is an issue will depend on how the probability distribution varies based on those settings. However, at minimum you should be thinking in terms of millions of samples for training, or possibly a fast on-demand generator that can generate 1000s of new samples per second to train with.
You can test accuracy by building histograms using some fixed (and as yet unseen) setting and comparing to NN predictions of probabilities of that setting. Even getting accurate test results is likely to require 1000s of samples.

However it may require a lot of training and data.

If you cannot obtain a very large training set here, then a purely statistical "black box" approach is probably not feasible, regardless of whether you use neural networks, or more raw analysis. What neural networks add is smooth interpolation between different settings values, as a form of approximation. This seems desirable for your problem, as you will never fully explore 40 dimensions of 100 values in the lifetime of the universe - but you need some confidence that minor changes in settings equate to minor changes in probability distributions in most cases.
It's OK to have one or two major shifts across the input space, but if the distribution depends in some cryptographic primitive or similar complex high frequency (over space) and high amplitude on the input variables, there is no way to obtain approximations using statistics.
The alternative to statistical approaches is to find some way to break open this black box through analysis. No AI system can do that in general at the moment, so you would rely on human ingenuity.

while I have a lot of input variables, I know there is some underlying rule that simplify a lot the problem (ie. reduce the actual number of dimension of the input). if I apply a statistical analysis I would need to make assumption on the rules to simplify beforehand. I would rather the NN to infer it from its training. I can generate 1-2 tests/s. what about the 2nd approach of evaluating the loss on a group of test cases ?

@SteveMarion: In that case it may be tractable. You will still need a lot of training data for the network to learn about this embedded lower-dimension problem.

@SteveMarion: A NN is a statistical method. It  "infers" data that is available statistically. You don't need to pre-analyse anything before feeding into a NN, and I don't suggest you need to in this answer. With 1-2 tests/second it should take you about 2 weeks to generate a dataset of a million records. Assuming that is automatic and not a manual process, that seems quite a reasonable time investment for data gathering. Of course that number is a guess and there are ways to check whether more data would be more useful before making the effort


text:
Inverting intensity on images to enhance image dataset
i just tried to improve my image dataset by inverting the images with a probability of 50% (means white background, black features transforms to black background, white features)
I thought this will improve the ability to recognize abstract features for my network. Right now, the network does not perform really well. Is inverting the intensity of images too much for a training algorithm to deal with?


text:
Paper & code for "unsupervised domain adaptation" for regression task
Does anyone know a paper or code that does "unsupervised domain adaptation" for regression task?
I saw most of the papers were benchmarked on classification tasks, not regression.
I want to do something like training a model to predict a scalar value from an image (e.g. predicting image of a road to steering wheel angle for a self-driving car).
One of the examples could be training on synthesis data from simulated environment (think GTA) and then trying to predict on real-world.
Here is one of the examples of unsupervised domain adaptation algorithm that also has an easy-to-access code with Keras: https://github.com/bbdamodaran/deepJDOT
But it's for classification. The author said it can be used for regression but I had to change it. I changed it and it didn't work well so I don't know if it's my fault or the algo is not good for regression. I want to see papers that were benchmarked on regression so I know how well it performs on regression.
My real use case is to predict facial expression as a value from 0 to 1 like how open is the mouth. The source domain and target domain are real-world images but from different lighting.
Any suggestions are appreciated.

DeepJDOT is now working well. I have contributed to the author's code and now it's working for regression as well.


text:
Binary annotations on large, heterogenous images
I'm working on a deep learning project and have encountered a problem. The images that I'm using are very large and extremely detailed. They also contain a huge amount of necessary visual information, so it's hard to downgrade the resolution. I've gotten around this by slicing my images into 'tiles,' with resolution 512 x 512. There are several thousand tiles for each image.
Here's the problem—the annotations are binary and the images are heterogenous. Thus, an annotation can be applied to a tile of the image that has no impact on the actual classification. How can I lessen the impact of tiles that are 'improperly' labeled.
One thought is to cluster the tiles with something like a t-SNE plot and compare the ratio of the binary annotations for different regions (or 'classes'). I could then assign weights to images based on where it's located and then use that as an extra layer in my training. Very new to all of this, so wouldn't be surprised if that's an awful idea! Just thought I'd take a stab.
For background, I'm using transfer learning on Inception v3.


text:
Is there a place where I can read or watch to get an accurate TensorFlow code wise explanation?
I have a piece of code and I don't seem to really understand it but I'd love to get a source/link/material that would help me understand the basic functions in TensorFlow. Are there any recommended resources for learning the same?

there exists abundant amounts of tutorials on tensorflows webpage, maybe start there

Hi and welcome to this community Anandhu! What do you mean by "accurate tensorflow code wise explanation?". Also, which code are you talking about when you say "I have this code"?

man i just wanna know how the basic functions of tensorflow works like the model.fit and all those so I was wondering if there are any top recommended sources for this and thanks for the welcome. @nbro


text:
Product Configuration based on user selection of features and other requirements
Is this a scenario that would work well for a ML/Pattern Recognition Model or would it be easier/faster to just filter from a large DB.
I am looking to create a system that will allow users to identify the appropriate product by specifying certain constraints and preferred features.
There are millions of possible product configurations. Lets pretend it's boxes.
Product Options:

Size (From 1mm up to 1m) in 1mm increments
Color: choice of 10 colors
Material: choice of 3, wood,metal, plastic

Constraints:

Wood is only available in centimeter units
Red is only available in 500 mm and greater
Wood is the preferred material
Blue is the preferred color

So, we have 30,000 (1000*10*3) possible options.
Of those, many are not viable such as 533 mm-Red-Wood
but these configurations similar to the request are possible.

533 mm-Red-Plastic
530 mm-Red-Wood
540 mm-Red-Wood

Notes:
Our current Rules and code based tool can take anywhere from 0.5 to 2 mins to identify the preferred configuration.
We can generate a list of all possible configs and whether they are valid or not.
We estimate 30,000,000 possible configs
It takes around 0.5 seconds to validate a config so with enough computing power we expect we could do 30M in a few days.