text:
What are the advantages of time-varying graph CNNs compared to fixed graph?
As I wrote in the title, what are the advantages of time-varying graph CNNs compared to fixed graph? For example, in CORA, which is a graph of citation relations of papers frequently used in graph CNN, what examples are there?

Are you asking the difference between the architectures? CORA is a dataset. "what examples are there?", of what?

@nbro i mean what is the advantage of using CNN of a time-varying graph to CORA compared to using CNN of a fixed graph to CORA?

What do you mean by CNN of a time-varying graph and CNN of a fixed graph? Do you mean respectively a time-varying GCN and a non-time-varying GCN?

@nbro yes, sorry for my bad english


text:
Is there any readily available concept/topic tree?
I am looking for dataset in tree structure that captures the hierarchy of concepts.
For example, something like,
                         Entertainment
                   Movies           Sports
              Comedy  Thriller   cricket football
   charlie chaplin              sachin       messy

Not sure if it will construct that specific tree for you, but have you checked http://conceptnet.io/ to see if it is suitable for your purpose? Perhaps explain a bit more about what you need this tree for - or traits that it should have - as there are lots of ways to break down knowledge like this. Typically a simple tree structure is very poor at capturing how language is used inpractice

@NeilSlater I am looking for this tree for say someone subscribes to a topic called sports, I would probably want them to be automatically subscribed to all kinds of sport, like cricket, football etc.

The issue for you then is that there is no such tree in general for natural language. It depends on your problem domain. Shopping will be different to media consumption. If your topic list is small enough, then the classic way to do this in e.g. web site design is a "card sort" https://www.usability.gov/how-to-and-tools/methods/card-sorting.html - I suggest that you add your use case to the question, as you really are looking for a simplified tree for your domain. It's probably not an AI topic, unless you want to ask about constructing the tree from something more complex

source: Stack Exchange

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

sort: votes


text:
Is a neural network the correct approach to optimising a fitness function in a genetic algorithm?
I've written an application to help players pick the optimal heroes during the draft phase of the Heroes of the Storm MOBA. It can be daunting to pick from 80+ characters that have synergies/counters to other characters, strong/weak maps, etc. The app attempts to pick the optimal composition using a genetic algorithm (GA) based on various sources of information on these heroes.
The problem I've realized is that not all sources of information are created equal. At the moment I'm giving all sources roughly equal importance in the fitness function but as I add other sources, I think it's going to be necessary to be more discerning about them.
It seems like the right way to do this would be to use a single layer neural network where the weights of the synapses represent the weights in the fitness function. I could use matches played at a high-level (e.g. from MasterLeague.net) to form the training and test sets.
Does this sound like a viable approach or am I missing something simpler?  Is the idea of the using a GA even the correct way to approach this problem?

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


text:
How to recognize with just name and last name if the person is a political exposed person
First than all, I am not sure if this questions is more about Machine Learning, or if its Artificial Intelligence, if not, just let me know I will delete it.
At my company we need to create a solution for banks, where a client comes in and they want to to open a bank account.
They need to know if that person is a politician or political exposed person, maybe they work in the european comission, or they are family from a pep for example.
The business users has lots of data sources where to get these people, for example: http://www.europarl.europa.eu/meps/en/full-list/all
They want to train a Model (Machine Learning), where the end user can enter the name:  Bill Clinton for example, and then the system has to return the percentage of a person being political or not.
Obviosly some persons are 100% politicial and the percentage will be 100%.
But if they enter a name that is not in any of their data sources, how would I train a model to decide if its pep or not?
quite confused
thanks

From just the name, even "Bill Clinton" is not going to be 100% political. In fact, probably less than 20%. Most names are repeated. According to Google, I am a well-known jazz musician in the USA, the author of a fishing book in Australia, a Microsoft developer in the UK.

good point indeed

In a certain sense, this is like asking "given just the last digit, write an AI to determine if a number is prime". One, you do not have enough information to start with, and two, you skipped the step of determining whether an AI is in fact the right tool for the job.

But if they enter a name that is not in any of their data sources, how would I train a model to decide if its pep or not?

Based on just a person's name and nothing else, the accuracy of this model is going to be very low. Consider that most first name, surname combinations in Europe are going to be repeated across the population.
However, the accuracy might still be slightly better than guessing. Some families and social classes could be more likely to be involved in political work, and a statistical model would pick up on that.
To train the model, take your positive names, and combine with a random selection of names of people that are known to be "not political" or similar enough. It doesn't matter if some of the names are the same provided you are confident in your data. Probably you could just take a phone directory or the electoral register or some other list of general names. Provided your "political" people are a small fraction of all people, this will work well enough even if you have some of them in the negative class.
Ideally you mix those name groups in the rough proportion that the bank expects to see "political" and "non-political" customers, so that your data set is a good representation of the target population.
Then you train a classifier on the names. As this is text and sequence data, you will need a solution for that. Possibly LSTM would be suitable architecture, but so might some feature selection from the names in a more simple ML model.
Remember to hold back some data (both positive and negative cases) for cross-validating and testing the model.
Expect the accuracy of your model when testing to be low. Very low. I would not at all be surprised to find the end result unusable by itself.
If this is seriously to be part of some bank's account setup process, there needs to be additional data used later in the process. A gate for additional checks based purely on someone's name will perform very poorly in my opinion.

thanks for the answer, thats why I asked, I am not an expert, but guessing something with just the name seems very difficult if not impossible to have a usable result.

@LuisValencia: Yes, unless you pick a target that is strongly correlated with the name, such as what page of a telephone directory they will appear on, or whether two people are related (and this second one is never something you really want to guess with no other data)

I'm not sure why this is upvoted. For a bank, a solution like this is criminally bad. Banks have a legal "Know Your Customer" obligation. Using something like this would be a reason for the supervising authority to summon the CTO for a chewing out. Seriously.

@MSalters: I agree the situation is bad if this was used for real. That is not what the question is about however, and out of scope for AI Stack Exchange. I think the caveat in the last paragraph covers all that is necessary here. There is no evidence that anyone is considering doing this for real other than a thought experiment, and even if there were I think the correct place to handle those concerns would be Workplace, Security or other Stack Exchanges. All this site can realistically offer is "statistically the result will be very poor".

@MSalters: If you can offer an improvement to the answer which covers concerns, but doesn't jump on the OP just for asking a "can AI really do this" kind of question (answer, as here: yes, sort of, but it would not be usable, or possibly: no, not really, but you might see the needle move) then I'd be happy to incorporate it provided it doesn't turn the whole answer into: "don't do this"


text:
Scikit-Learn: monotoneous quantile estimation
I would like to implement various AI-estimators for quantile estimation for a regression problem. It would be necessary to have non-crossing quantiles, that is larger quantiles would correspond to higher prediction values.
My objective is to have a multidimensional prediction vector as an output in the estimation, each dimension corresponding to a specific quantile. Maybe I would have to define a custom loss function, as well, for that purpose. I would like to try different methods such as deeplearning or gradient boosting or random forests.
Anyone having an idea how to build such AI-estimators? My preferred library choice would be scikit-learn.
Can someone give me an idea how to do this?


text:
Was the corruption of Microsoft's "Tay" chatbot an example of catastrophic forgetting?
Tay was a chatbot, who learned from Twitter users.

Microsoft's AI fam from the internet that's got zero chill. The more you talk the smarter Tay gets. — Twitter tagline.

Microsoft trained the AI to have a basic ability to communicate, and taught it a few jokes from hired comedians before setting it lose to learn from its conversations.
This was a mistake.
But why did Tay go so wrong? Was this an example of catastrophic forgetting, where short, recent trends override large, less recent training, or was it something else entirely?

It was essentially a lack of control over crowd-sourced training data.
While Tay was initially set up with some conversational ability, it seemed to be programmed to learn from interactions with other users. Once users became aware of this, they basically gamed the bot by exposing it to inappropriate language, which Tay's algorithms then picked up and repeated. According to the Wikipedia article on the topic, it is not known for sure whether its repeat after me facility was solely at fault, or if there was other behaviour that caused it.
It's not really an example of catastrophic forgetting; for once we don't know how Tay worked internally. I would think it's just that it was overwhelmed by new data coming in which was different from the pre-set. It seems unlikely that the kind of language it was exposed to was in any way known in advance and part of its training set (and labelled as 'inappropriate').
Essentially, the lesson from this is to never trust any unvetted input data for training, unless you want to risk people abusing this trust as happened in this case.

Looking at what happened, it was something similar. Though, the case differs in my eyes from one perspective: if it could only do a few comedy jokes, that probably is not a profound starting point to excel in Twitter.
Firstly, Twitter is about real life, not about comedy. Discussions are sometimes tough and you easily end up to Social Media Bubbles, where only a certain kind of speaking style and topics is cultivated. So, even humans get on the wrong track there; why not a newbie bot? And, with jokes you would probably catch something about language itself, but not about the topics. So, becoming a jerk instead of a nice comedian is a logical direction, where the bot even has to go, at least a little, to communicate on same level, and not alone.
The comedian dataset compared to a Twitter dataset is also very small in a technical sense, so talking about a mini trend overkilling a megatrend in this case is probably not true, because of amounts of examples available.
So, catastrophic things happened in learning, but not catastrophic learning with the definition of that term.


text:
Improving the performance of a DNN model
I have been executing an open-source Text-to-speech system Ossian. It uses feed forward DNNs for it's acoustic modeling. The error graph I've got after running the acoustic model looks like this:

Here are some relevant information:

Size of Data: 7 hours of speech data (4000 sentences)
Some hyper-parameters:

batch_size       : 128
training_epochs  : 15
L2_regularization: 0.003

Can anyone point me to the directions to improve this model? I'm assuming it is suffering from over-fitting problem? What should I do to avoid this? Increasing data? Or changing batch-size/epochs/regularization parameters? Thanks in advance.

What is going on with higher regularization parameters?


text:
How to stay a up-to-date researcher in ML/RL community?
As a student who wants to work on machine learning, I would like to know how it is possible to start my studies and how to follow it to stay up-to-date. For example, I am willing to work on RL and MAB problems, but there are huge literatures on these topics. Moreover, these topics are studied by researchers from different communities such as AI and ML, Operations Research, Control Engineering, Statistics, etc. And, I think that several papers are published on these topics every week which make it so difficult to follow them.
I would be thankful if someone can suggest a road-map to start studying these topics, follow them and how I should select and study new published papers. Finally, I am willing to know the new trend in RL and MAB problem.

There are some wonderful resources for keeping up to date in the ML community. Here are just a handful that a coworker showed me:

Deep Learning Monitor: this site contains hot and new papers along with tweets that are popularized by the community! You can even checkout RL papers specifically here
arxiv-sanity: this site updates with popular and new papers that make it onto Arxiv
papers with code: this site is wonderful because not only does it link to papers, but it links to their implementation for reproduction or assistance in your own personal projects. They even have a leaderboard and track state of the art (SoTA) on tons of different tasks
DL_twitter loop: You can't forget twitter, given that most researchers use it; this is just a single nice group you may like


text:
Spikes in of Train and Test error
I learn a DNN for image recognition. During each epoch, I calculate mean loss in the training set. After each epoch, I calculate loss and number of errors over both training and test set. The problem is, training and test error go to (almost) zero, then increase, go to zero again, increase, and so on.  The process seems stochastic.
epoch: 1 mean_loss=0.109 train: errs=7 loss=0.00622 test: errs=3 loss=0.00608
epoch: 2 mean_loss=0.00524 train: errs=5 loss=0.00309 test: errs=3 loss=0.00369
epoch: 3 mean_loss=0.00408 train: errs=13 loss=0.00614 test: errs=7 loss=0.00951
epoch: 4 mean_loss=0.00198 train: errs=113 loss=0.102 test: errs=51 loss=0.265
epoch: 5 mean_loss=0.00424 train: errs=3 loss=0.00201 test: errs=2 loss=0.00148
epoch: 6 mean_loss=0.0027 train: errs=1 loss=0.000466 test: errs=2 loss=0.00193
epoch: 7 mean_loss=0.00797 train: errs=5 loss=0.00381 test: errs=0 loss=0.000493
epoch: 8 mean_loss=0.00368 train: errs=1 loss=0.000345 test: errs=2 loss=0.00148
epoch: 9 mean_loss=0.000358 train: errs=0 loss=6.76e-05 test: errs=0 loss=0.000446
epoch: 10 mean_loss=0.00101 train: errs=164 loss=0.0863 test: errs=67 loss=0.19
epoch: 11 mean_loss=0.000665 train: errs=0 loss=2.38e-05 test: errs=0 loss=9.86e-05
epoch: 12 mean_loss=0.00714 train: errs=5 loss=0.00909 test: errs=0 loss=0.00816
epoch: 13 mean_loss=0.00266 train: errs=73 loss=0.0333 test: errs=10 loss=0.0192
epoch: 14 mean_loss=0.00213 train: errs=0 loss=7.74e-05 test: errs=0 loss=0.000197
epoch: 15 mean_loss=6.12e-05 train: errs=0 loss=7.66e-05 test: errs=0 loss=3.44e-05
epoch: 16 mean_loss=0.00162 train: errs=5 loss=0.00265 test: errs=0 loss=0.0012
epoch: 17 mean_loss=0.000159 train: errs=0 loss=3.11e-05 test: errs=0 loss=4.26e-05
epoch: 18 mean_loss=4.68e-05 train: errs=0 loss=3.28e-05 test: errs=0 loss=6.05e-05
epoch: 19 mean_loss=2.47e-05 train: errs=0 loss=2.8e-05 test: errs=0 loss=5.01e-05
epoch: 20 mean_loss=2.2e-05 train: errs=0 loss=2.31e-05 test: errs=0 loss=3.95e-05
epoch: 21 mean_loss=2.37e-05 train: errs=0 loss=1.76e-05 test: errs=0 loss=2.52e-05
epoch: 22 mean_loss=1.4e-05 train: errs=0 loss=1.16e-05 test: errs=0 loss=1.52e-05
epoch: 23 mean_loss=2.13e-05 train: errs=0 loss=1.65e-05 test: errs=0 loss=2.13e-05
epoch: 24 mean_loss=1.53e-05 train: errs=0 loss=1.91e-05 test: errs=0 loss=2.46e-05
epoch: 25 mean_loss=0.00419 train: errs=0 loss=5.27e-05 test: errs=0 loss=4.65e-05
epoch: 26 mean_loss=0.000372 train: errs=6 loss=0.00297 test: errs=3 loss=0.00731
epoch: 27 mean_loss=0.0016 train: errs=0 loss=4.23e-05 test: errs=0 loss=3.69e-05
epoch: 28 mean_loss=3.34e-05 train: errs=0 loss=2.44e-05 test: errs=0 loss=2.76e-05
epoch: 29 mean_loss=7.03e-05 train: errs=0 loss=2.16e-05 test: errs=0 loss=1.69e-05
epoch: 30 mean_loss=2.41e-05 train: errs=0 loss=1.84e-05 test: errs=0 loss=1.77e-05
epoch: 31 mean_loss=1.26e-05 train: errs=0 loss=2.11e-05 test: errs=0 loss=1.78e-05
epoch: 32 mean_loss=1.39e-05 train: errs=0 loss=2.75e-05 test: errs=0 loss=2.42e-05
epoch: 33 mean_loss=7.68e-05 train: errs=0 loss=0.00014 test: errs=0 loss=4.66e-05
epoch: 34 mean_loss=2.53e-05 train: errs=0 loss=1.48e-05 test: errs=0 loss=1.56e-05
epoch: 35 mean_loss=0.000352 train: errs=1786 loss=2.17 test: errs=493 loss=2.56
epoch: 36 mean_loss=0.0088 train: errs=0 loss=0.000347 test: errs=0 loss=0.000449
epoch: 37 mean_loss=0.000395 train: errs=0 loss=6.18e-05 test: errs=0 loss=0.000125
epoch: 38 mean_loss=5e-05 train: errs=0 loss=6.73e-05 test: errs=0 loss=9.89e-05
epoch: 39 mean_loss=0.00401 train: errs=26 loss=0.00836 test: errs=27 loss=0.0269
epoch: 40 mean_loss=0.00051 train: errs=0 loss=7.66e-05 test: errs=0 loss=7.07e-05
epoch: 41 mean_loss=5.49e-05 train: errs=0 loss=2.47e-05 test: errs=0 loss=2.58e-05
epoch: 42 mean_loss=3.38e-05 train: errs=0 loss=1.67e-05 test: errs=0 loss=2.1e-05
epoch: 43 mean_loss=2.45e-05 train: errs=0 loss=1.28e-05 test: errs=0 loss=2.95e-05
epoch: 44 mean_loss=0.00137 train: errs=44 loss=0.0141 test: errs=16 loss=0.0207
epoch: 45 mean_loss=0.000785 train: errs=1 loss=0.000493 test: errs=0 loss=4.46e-05
epoch: 46 mean_loss=5.46e-05 train: errs=1 loss=0.000487 test: errs=0 loss=1.34e-05
epoch: 47 mean_loss=1.99e-05 train: errs=1 loss=0.00033 test: errs=0 loss=1.57e-05
epoch: 48 mean_loss=1.78e-05 train: errs=1 loss=0.000307 test: errs=0 loss=1.58e-05
epoch: 49 mean_loss=0.000903 train: errs=1 loss=0.00103 test: errs=0 loss=0.000393
epoch: 50 mean_loss=4.74e-05 train: errs=0 loss=4.63e-05 test: errs=0 loss=3.53e-05
Finished Training, time: 234.69774420000002 sec

The images are 96*96 gray.  There are about 7000 training and 1750 test images. The order of presentation is random, and different at each epoch. Each image is either contains the object or not.  The architecture is (Conv2d->ReLU->BatchNorm2d->MaxPool)*4->AvgPool(6,6)->Flatten->Conv->Conv->Conv.  All MaxPool's are 2*2. First two Conv2d layers are 5*5, padding=2, others 3*3, padding=1.  The optimiser is like this:
Optimizer= Adam (
Parameter Group 0
    amsgrad: False
    betas: (0.9, 0.999)
    eps: 1e-08
    lr: 0.001
    weight_decay: 1e-05
)

Currently I just choose the epoch when the training set error was minimal.
if epoch == 0 or train_loss < train_loss_best:
    net_best = copy.deepcopy(net)
    train_loss_best = train_loss

It works, but I don't like it. Is there a way to make the learning more stable and steady?

Hi. Please, ask this question on Data Science SE, given that involves the debugging of source code, which is usually off-topic here.

@nbro no, it is not about source code.  It is about the process of learning a deep NN, architecture, and learning parameters.  I am pretty sure my source code have no significant bugs, and there are only 3 lines of source code in my whole question, and I only give them to explain what exactly I am doing in some specific place.


text:
Estimating camera's offset to its true position
I have the following problem:
I get a 360 RGB image in a room.

I've the 3D model of this room, hence, I can generate a 3D nominal mask of the room (1-wall, 2-ceiling, 3-floor, 4-door, etc..) in a specific location (x0,y0,z0,roll0,pitch0,yaw0)
I can also generate the depth map of this location.

My model has to predict whether the generated mask+depth match with the RGB frame, and if not what are the dx, dy, d_yaw of the offset.
I've implemented pix2pix discriminator that receives a concatenated tensor of the [RGB, one-hot mask, depth] and yields the (dx, dy, d_yaw).
obviously, if there is a perfect match, dx=dy=dyaw=0.
Unfortunately my model isn't converging. I've tried everything, and it's a reasonable "request" from this model, since a human can roughly guess this offset if he looks on the images.
what would you suggest?


text:
Is Hopfield network more efficient than a naive implementation of Hamming distance comparator?
Is Hopfield network more efficient than a naive implementation of Hamming distance that compare an input pattern and return the nearest pattern ?

"and return the nearest pattern", return the nearest pattern from where? The memory? A database? The Hamming distance is a value that represents the dissimilarity between two strings (at most, it is an algorithm to compute such value), whereas the Hopfield network is a model. These are two apparently completely different concepts. So, why are you even trying to compare them?

From a database which contains all the vectors of 1 and -1 possible. Yes, this is why I wrote "a naive implementation of Hamming distance that compare patterns" and not just "Hamming distance". So I am not trying to compare a (metrical) distance with a network, but the algorithm that implements brutally / naively comparisons (which criteria is the Hamming distance) of an input pattern with all the patterns that we want to retrieve.

For example, imagine we stored two vectors (1 1 1) and (-1 -1 -1) in database and when we give an input like (1 1 -1) we want the algorithm to return (1 1 -1) after having him compare the input (1 1 -1) with (1 1 1) and with (-1 -1 -1) and find that the input (1 1 -1) is closer to (1 1 1) than to (-1 -1 -1).


text:
Are there some formulae in facial recognition that are indicators of close kinship?
I noticed what I considered a close resemblance of a woman B to another woman A which led to a close relative A labelled C, who B bore an even stronger resemblance to than she did to A.
However I feel that if I had compared A to C directly I wouldn't have detected the blood relationship so strongly.
I am just wondering whether there is some mathematical underpinning to my perception and strong intuition that B bore a strong resemblance to A.

please ask your question is a WAY less scrambled manner

How do you characterise less scrambled? This is not an area I am familiar with so I am not quite sure of what terminology to use. I could use pictures to describe it, but has it has interracial dimension that is likely to derail the threadbut I want to be sure that some mathematics exists along such lines before prejudicing the response

@mshlis Feel free to edit it in accord with a more "scientific" way if you understand the question well enough


text:
How would an AI work out this question?
I am trying to create an AI that makes reasonable guesses at truths of statements. However...
Human: "Prove that no number exists which is one more than a billion."
AI: "Is it true for the number 1? No. I am 1% sure the statement is correct."
AI: "Is it true for the number 2? No. I am 2% sure the statement is correct."
...
AI: "Is it true for the number 999,999? No. I am 99.99% sure the statement is correct."
AI: "Having tested a large number of examples. I conclude that the statement is correct."
Human: "The statement is wrong: one billion and one."
What do you think has gone wrong?

I believe that the whole reasoning is wrong. The fact that his certainty increases with the number is also weird: it is like the higher the number the more certain the AI is, which makes no sense. Furthermore, there's also the problem of not being able to generalise.

The AI didn't try to disprove it... it hadn't "understood" the misleading question to a level where it could find the fastest route to a disproof (or proof). Disproof may be a missing strategy.

I don't think that the "try all the numbers" approach is very representative, because I'm not sure whether or not the agent that uses that approach can be considered by any means AI.
There is no "intelligence" in just checking numbers to try to prove the statement. An agent that is considered to be intelligent should apply a more intelligent approach.
This becomes more evident because the question aims at exploiting the lack of scalability of the agent's strategy. If the question was "Prove that no number exists which is one more than 5", then the agent would have no trouble in finding the correct answer.

Yes, perhaps the AI (or a human child) would have "noticed" some time ago that to get a bigger number all you have to do is add one to any number. And using this knowledge could solve the problem.


text:
Entropy term in Proximal Policy Optimization (PPO) becomes undefined after few training epochs
I have implemented the total loss of my PPO objective as follows:-
total_loss = critic_discount * critic_loss + actor_loss -  entropy_beta * K.mean(-(newpolicy_probs * K.log(newpolicy_probs)))

After training for a few epochs, the entropy term becomes "nan" for some reason. I used tf.Print() to see the new policy probabilities when the entropy becomes undefined, it is as follows-

new policy probs: [[6.1029973e-06 1.93471514e-08
  0.000299338106...]...]

I am not clear as to why taking log of these small probabilities is coming out as nan. Any idea how to prevent this?

Log of zero is mathematically undefined. On a computer, the log is likely approximated (it depends on the implementation). Furthermore, the multiplication of small numbers creates even smaller numbers (e.g. the product of $0.1*0.1 = 0.01$), which leads quite quickly to the "vanishing problem". Are you using floats (single-precision) or doubles? If you're using floats, maybe try using doubles? Or maybe try to manually handle the case where too small probabilities that are passed to the log. If this answers your question, let me know, and I will convert this comment to an answer.

However, note that this question is off-topic here. You should ask it on Stack Overflow, given that this is a problem related to the implementation. Here we focus more on conceptual and philosophical questions.

I addressed my implemetation issue with the solution in my answer below. However, I still have conceptual doubts so I opened a separate question here: https://ai.stackexchange.com/questions/13577/understanding-log-probabilities-of-actions-in-ppo-objective , thanks for the advice!

I did handle small values manually by adding 1e-10 so if you want to post it as an answer I'll accept it.

I browsed through some other implementations of PPO and they all add small offset (1e-10) to prevent undefined log(0). I did that and the training works now.


text:
Use deep learning to rank video scenes
I'm new to machine learning and especially, deep learning. Given a video (and it's subtitle), I need to generate a 10-second summary out of this video. How can I use ML and DL to produce the most representative summary out of this video? More specifically, given video scenes, what are some ways to select and rank them, and how to do it? Any ideas would be helpful.

It’s seems like quite challenging problem; at least you would need quite a lot of annotated data and computational power.
The approaches/optimizations you could consider:

To make scene change detection and take short piece out of each
To introduce some kind of “novelty” metric and try to maximize
it to get most different parts of video
To convert video to kind of vector with existing solution like
r-cnn and yolo and then process it with recurrent networks.
The task seems to be very close to video capturing/summarization, you
can take inspiration there
Also, the attention approach might be handy, look, for example
self-attention for video,
semantic attention for
video

Thanks. Yeah first one I'm doing already. Basically all conventional non-DL based approaches. Can you elaborate more on r-cnn and how to use YOLO? The latter is only for object detection, so not sure how.

R-cnn solves the same task as yolo, just another approach.
The problem with video is that they are very high dimensional and you would need a really big dataset to train directly. For example

Mnist is 28x28 and you need 50’000 to get result
Imagenet 224x224x3 and you need 14’000’000 images
5 minutes video would be 640x480x3x7200. So you would need billions of annotated videos to train directly.

It’s basically impossible, so you need to reduce the dimensiality in some way. With yolo instead of images you can construst the vector that represents that “we have two objects that look like humans standing near object looking like car”, so, the dimensions would be like 2000x7200 and it would be more managable for DL approaches.
Another way would be to understand how you on your own ranking the scenese and why; then you can try manual feature engineering. Here I would argue yolo would be helpful as well, because it’s easier to deal with some semantic data then raw images.

I see. One idea came to my mind is to tag those shots I'm interested as 1 and others as 0, and train a model on only those shots against the rest. How do you think it will work? And what's the process?


text:
How can I keep context in my chatbot
I have created a chatbot by Keras based on movie dialog. I used RNN more specifically GRU . My bot can reply well. But the problem is , it can't hold the context . As an example if I say Tell me a joke, the bot will reply something , and then if I say one more , the bot simply doesn't understand that I was asking for another joke and many more similar cases, like if I used a slang against the bot , the bot will reply me with something similar , but if I just say something romantic or good immediately after using slang , the bot will reply to me with something good . I want to keep context or environment . How can I do so . Any lead would be helpful .

Could you add a little more context about your current model? I would guess it is a seq2seq model that "translates" a phrase input by user into a reply phrase. The behaviour you notice is definitely a limitation of using seq2seq like that.

Yes u are right , I am using seq2seq . Is there any alternative which can solve my problem ?

There's lots of ways to make chatbots. You could ask about comparison between a couple of methods (but please don't ask for some full guide or review, it's  too much for a question here). Or your current question is OK in my opinion, if you use [edit] to add some details from your comment, so that people have some clue to what you've got compared to where you want to go next. I'm not a chatbot expert, but I think you are in the right place to ask such a question. I just think it would help you get the best answer if you say a little more about your current model.

It may also help if you explain your longer-term goal. Is your chatbot intended for some specific use? Or is the main purpose in building it to teach yourself topics in Natural Language Processing and AI? If the former, you may want to fall back on more robust simple methods than neural networks. If the latter, it may not be too important to you if the bot has flaws provided it exhibits some interesting behaviour such as assigning pronouns correctly between different exchanges at least some of the time

This is an idea that I used for my model -
Try using two RNN (GRU) Networks, one of them to manage current output state and the other to maintain context
Say we are at timestamp $t$ and the two GRUCells are represented as $GRU_c$ and $GRU_s$ for GRU context network and state network. (Your output coming from the state network)
At time stamp $t$ , the input $GRU_s(t) = concat(input, att(all~GRU_c~from ~[0, ~t-1]))$ where $att$ is an attention mechanism to give importance to specific parts of the conversation uptil that point (This is what maintains context)  and input $GRU_c(t) = learned~representation~of~GRU_s(t)$ , hence updating $GRU_c$ for that timestamp, which along with the historical information can be used for $GRU_s(t+1)$
Hope this helped!


text:
How can we use Dependency Parsers for Negation detection
I am building a negation detection system. How to use dependency parsers for the same. I am using SPACY for dependency parser


text:
How to use the LSTM layer in PPO architecture?
What is the best way of using the LSTM layer in PPO architecture?
Should I use them in the first layer of both actor and critic, or use them just before the final layer of these networks?
Should I feed the architecture with a stack of states (the state stacked with the k previous states)?

Not sure if you're using TensorFlow-Agents for this, but if you are, there's some nice functionality for this built out using the ActorDistributionRnnNetwork and ValueDistributionRnnNetwork that I've found to be very helpful.  The LSTM architecture is used in both the actor and critic networks.  See this page for more information - hope this helps!


text:
Understanding policy update in PPO2
I have a question regarding the functionality of the PPO2 algorithm together with the Stable Baselines implementation:
From the original paper I know that the policy parameters $\theta$ are updated K-times using the steps sampled (n_env * T steps):

When updating the policy parameters for a state $s_t$, are only the state observations $a_t$ and reward $r_{t+1}$ of this step considered, or also the state observations and rewards of the following steps ($t+1$) considered? My understanding is that the policy update with stochastic gradient ascent works just like in supervised learning.
I know that PPO2 uses a truncated TD($\lambda$) approach (T timesteps considered). So I guess that during the policy update for each state, subsequent states are only considered through the advantage function $A_t$ but not through the values of subsequent state observations and rewards themselves? Is that true?
I do not quite get the Stable Baselines implementation in the method _train_step() of the PPO2 implementation so therefore the question here.


text:
Where to find pre-trained models for multi-camera people tracking?
I need to build a multi-camera people tracking system and I have no idea how to start. I read ML for Dummies and I've watched a lot of youtube classes/conferences and read a lot of articles about ML/DL, so I have all this theoretical information about what is a NN, loss function, weights, vectors, convolution, etc., but when I need to start building something, I get stuck. Even more, I don't think I can create my own models because I only have six months to finish this and I'm not sure if I'll be able to do it.
I've read some papers explaining architectures for an improved people-tracking system (e.g. https://www.intechopen.com/online-first/multi-person-tracking-based-on-faster-r-cnn-and-deep-appearance-features#B8), and it says it used ResNet-30 and stuff like that. My question is, how could I recreate the architectures in papers like that? Where can I find those pre-trained models? Or is there a place where I can get the data?
I want to start with at least a people-tracking system, without worrying about the multi-camera part for now, and I thought of almost the same approach as the people in the paper posted, meaning I want to recognize people based on parts of their body/the whole body to identify them, and track them based on their unique features (clothing color, hair, skin tone, etc), maybe skipping the part of facial recognition since that's too advanced I think.
Any idea on where to start?
Sorry if the question is too broad or too complex. Comments about first steps and sub-dividing the problem are also welcome.
PS: The main ultimate is to track how much time people are in a certain area filmed by many cameras.


text:
How to detect patterns in a data set of given IP addresses using a neural network?
How to detect patterns in a data set of given IP addresses using a neural network?
The data set is actually a list of all the vulnerable devices on a network. I want to use a neural network that detctes any patters in the occurrences of these vulnerabilities with reference to their IPs and ports.

is your dataset purely (ip, vulenerable) pairs or is there more, like a temporal aspect, etc

@mshlis the data set is purely (ip, vulnerable) pairs.

It seems that you want to detect ranges of IP addresses that are vulnerable/dangerous/etc, right? Such ranges are essentially numeric intervals, and so my suggestion is to look at decision tree learning instead of neural networks, because you are essentially doing a classification task where you want to test both categorical data and splits over numerical attributes.
The result will be a tree-like function (nested conditionals) of the form
IF ...> address > ...
   THEN [vulnerable]
   ELSE IF port=...
              THEN [not vulnerable]
              ELSE [vulnerable]

where a huge benefit is that it is also more human-readable than a neural net.
The most prominent algorithms for decision trees are ID 3 and its successor C4.5.

I have the data sets of couputers that is purely of the type (ip, vulnerability). I know which devices are vulnerable. I just want to detect a pattern to the occurrence of these vulnerable computers.

Could you please state more specifically what you mean by a "pattern"? What would be the desired outcome of the learning process? Could you perhaps give a small example?

After the learning process, I want it to give a general rule as to where in an network do the vulnerabilities occur with reference to thier IPs.

So the goal is to learn a mapping {IP addresses} -> {vulnerabilities}. Learning always involves some form of generalization or abstraction. In which direction should this happen? Is it "since addresses A,B,C have vulnerability X, neighbouring address D likely also has X" or the other way round, i.e. "addresses that have vulnerabilities X and Y often also have Z"?

the first type i.e. Is it "since addresses A,B,C have vulnerability X, neighbouring address D likely also has X.

Then the next question is what kind of structure you are able to exploit. In order for learning to happen, there has to be some way to generalize, meaning we have to be able to say that address D is in some sense similar/related/close to A,B,C. If all we have is the addresses themselves, all I can think of is treating them as numbers and assuming numbers close to each other are in a way "similar". This makes sense to a certain degree, namely when a group of addresses with the same prefix belong to the same subnet, and this is why I suggest attempting to learn address ranges (=intervals).

That is exactly what I had in mind.


text:
How to solve optimal control problem with reinforcement learning
The problem I am trying to attack is a predator-prey pursuit problem. There are multiple predators that pursue multiple preys and preys tried to evade predators. I am trying to solve a simplified version - one predator tries to catch a static prey on a plane. There is bunch of literature on the above problem when predators and preys are on the grid.
Can anybody suggest articles/code where such problem is solved on a continuous plane? I am looking at continuous state space, discrete action space (predator can turn left 10 degrees, go straight, turn right 10 degrees, runs at constant speed), and discrete time. MountainCar is one dimensional version (car is predator and flag is prey) and DQN works fine. However, when I tried DQN on two dimensional plane the training become very slow (I guess dimensionality curse).
The second question concerns the definition of states and reward. In my case I consider angle between predator heading vector and vector between the predator and prey positions. Reward is the change in distance between predator and prey, 10 when prey is captured, and -10 when predator gets too far from the prey. Is this reasonable? I already asked similar question before and with the help of @Neil Slater was able to refine reward and state.
The third question concerns when to update train network to target network. At each episode? Or only when prey is caught? Any ideas?
The last question I have is about the network structure: activation functions and regularization. Currently I am using two tanh hidden layers and linear output with l2 and dropout. Can anybody share some insights?
Thanks in advance!


text:
Does Retina-net's focal loss accomplish its goal?
Taking out the weighting factor we can define focal loss as
$$FL(p) = -(1-p)^\gamma log(p) $$
Where $p$ is the target probability. The idea being that single stage object detectors have a huge class imbalance between foreground and background (several orders of magnitude of difference), and this loss will down-scale all results that are positively classified compared to normal cross entropy ($CE(p) = -log(p)$) so that the optimization can then focus on the rest.
On the other hand, the general optimization scheme uses the gradient to find the direction with the steepest descent. There exists methodologies for adaption, momentum and etc but that is the general gist.
$$ \theta \leftarrow \theta - \eta \nabla_\theta L $$
Focal losses gradient follows as so
$$\dot {FL}(p) = \dot p [\gamma(1-p)^{\gamma -1} log(p) -\frac{(1-p)^\gamma}{p}]$$ compared to the normal crossentropies loss of
$$ \dot{CE}(p) = -\frac{\dot p}{p}$$
So we can now rewrite these as
$$\dot{FL}(p) = (1-p)^\gamma \dot{CE}(p) + \gamma \dot p (1-p)^{\gamma -1} log(p)$$
The initial term, given our optimization scheme will do what we (and the authors of the retinanet paper) want which is downscale the effect of the labels that are already well classified but the second term is slightly less interpretative and in parameter space and may cause an unwanted result. So my question is why not remove it and only use the gradient
$$\dot L =  (1-p)^\gamma \dot{CE}(p)$$
Which given a $\gamma \in \mathbb{N}$ produces a loss function
$$ L(p) = -log(p) - \sum_{i=1}^\gamma {\gamma \choose i}\frac{(-p)^i}{i}$$
Summary: Is there a reason we make the loss adaptive and not the gradient in cases like focal loss? Does that second term add something useful?

would you add details of "slightly less interpretative (and) in parameter space and may cause an unwanted result.", thanks.

Yes, the second term in the gradient doesn't really have a clear cut meaning. the first is the gradient for weighted CE so its impact will be just that, but this one is difficult to completely interpret, its a weighted copy of log(p)*dp, but what does that mean. I wrote a small blog post a couple years back talking about a possible fix to this: https://mshlis.github.io/FocalGradLoss/

thanks for your link. Have you tried to train neural network with only the second term?


text:
What loss function is appropriate for finding "points of interest" in a array of x,y inputs
I am looking into whether a neural network is appropriate to detect "points of interest" (POI) in a set of tuples (say length, and some sensor value). A POI is essentially a quick change in the value which doesn't follow the pattern. So if we have a linear increase in the sensor value and then it suddenly jumps by 200% that would be a POI.
Here is an example of the data I am working with:
[(1,10),(2,11),(3,14),(5,24),(6.5,25), (7,26), (8,45)]

In this example lets say "(3,14)", "(5,24)", and "(8,45)" are points of interest. So I am trying to design a neural network which will detect these.
I have started by creating a Convolution 1D layer with a static input length of 500 elements.
After a couple hidden layers I apply a sigmoid function which provides a list of 0s and 1s as output where 1s signify a POI in the set.
There are a couple of issues with this approach which I am trying to solve.
In a categorical loss function an output of [1,0,0,1,0,0] for example would be seen as completely inaccurate if the expected output is [0,1,0,0,1,0] whereas in reality that is fairly accurate since the predicted POIs are very close to the real POIs.
So what I am trying to do is find a loss function to optimize the neural network.
So far I have tried:

Binary Cross Entropy: I read this is good for classifying where inputs can belong to multiple classes. I tried this out thinking each POI is essentially a "category". But this seems to not work and I assume it's because of what I noted above.
Mean Absolute Error: This seems to have gotten slightly better results but after closer inspection it didn't seem very accurate and would mostly uniformly predict POIs on a set.

I have tried a few others without much luck.
What loss function would be more appropriate for this?
One other output I tried was instead of outputting 0s and 1s it should just return the indexes of the points of interest so say 3, 5 8. Would this be a better output?

You don't have to use machine learning to solve the problem.

Unify the scale of each data input (or each curve), such as normalize to $[0,1]$ (not necessary).
Calculate the slope of each pair of points $\frac{(y2 - y1)}{(x2 - x1)}$.
Set the threshold. Compare the difference between two adjacent slopes, the difference exceeds the threshold are marked as POI.

Isn't that simpler?
If you must solve the problem with CNN, what I can think of is that you first collect (or draw) a bunch of curves, mark the POI in advance, and then feed it to the CNN model.

Well, the neural network is being fed data which is being generated by a similar method to the above in order to train it. The issue we have with this is that the user may eventually mark a POI as "After 10 continuous points with the same value" or some other arbitrary POI so we don't want to have to re-code everything but instead just be able to feed new labelled data in.


text:
Train detector : 300 images with 30 objects or 9000 images with one?
so I have this dataset of images of people sitting in a restaurant.
I've annotated about 300 images with an average of 30 instances of "person" per image.
Now I'm wondering if I should have annotated only one (or just a few) person per image and processed way more images ?
I've successfully trained an SSD network with only one class, but I'm still wondering if I should have gone the other way...
Anyone got input on that ?
Cheers.


text:
Reverse engineering controller sensitivity/aim for several games ie acceleration curves, deadzones, etc
A machine learning project I am working on requires me to interface with an Xbox controller connected to a PC. The implementation must do the following two things:
Record the joystick input from the controller into a file at regular intervals, along with an associated screenshot from a game. (ex: 60 times a second).
With this data I want to try to replicate/reverse engineer a few different FPS games sensitivity’s,dead zones, acceleration curves.
Does anyone have any idea as to how I'd go about doing this? I'm not sure where to start. If this question isn't appropriate for this sub, I’m where could I ask?


text:
What is an identity recurrent neural network?
What is an identity recurrent neural network (IRNN)? What is the difference between an IRNN and RNN?

An identity recurrent neural network (IRNN) is a vanilla recurrent neural network (as opposed to e.g. LSTMs) whose recurrent weight matrices are initialized with the identity matrix, the biases are initialized to zero, and the hidden units (or neurons) use the rectified linear unit (ReLU).
An IRNN can be trained more easily using gradient descent (as opposed to a vanilla RNN that is not an IRNN), given that it behaves similarly to an LSTM-based RNN, that is, an IRNN does not suffer (much) from the vanishing gradient problem.
The IRNN achieves a performance similar to LSTM-based RNNs in certain tasks, including the adding problem (a standard problem that is used to examine the power of recurrent models in learning long-term dependencies). In terms of architecture, the vanilla RNNs are much simpler than LSTM-based RNNs, so this is an advantage.
For more details, see the paper A Simple Way to Initialize Recurrent Networks of Rectified Linear Units (2015), by Quoc V. Le, Navdeep Jaitly, Geoffrey E. Hinton. See also this Keras implementation of the MNIST experiment described in the linked paper.


text:
How do deep fakes get the right encoding for both people?
Deep fakes work by using a single encoder but then having a different decoder for different people.
But I wondered what if the encoder encodes say "closed eyes" of person A as the same code for "closed mouth" of person B. i.e. the codes could use the same codewords for different aspects of person A and person B. i.e. person A and person B could use the same codewords to descibe each of them except the codewords don't mean the same thing.
Then when you do a deep fake on person A with closed eyes it emerges as person B with a closed mouth.
How does one combat this effect. Or is does it just work and no-one knows why?


text:
Why do these reward functions give different training curves?
Let's say our task is to pick and place a block, like: https://gym.openai.com/envs/FetchPickAndPlace-v0/
Reward function 1: -1 for block not placed, 0 for block placed
Reward function 2: 0 for block not placed, +1 for block placed
I noticed training 1 is much faster than 2... I am using the HER implementation from OpenAI. Why is that?

Could you please clarify when the rewards are assigned? It makes a big difference to most RL algorithms whether the "block not placed" reward is given on every time step or just at the end as an assssment.

And also, it seems that 1st option has a priori denser rewards. I'm not familiar with the HER implementation, apart from the experience replay, does anyone know if it centers the expected reward somehow? (State functions or GAE)

These are given at each time step. The 'density' aka frequency of each type of reward is the same for each reward function.


text:
What is a high performing network architecture to use in a PPO2 MlpLnLstmPolicy RL model?
I am playing around with creating custom architectures in stable-baselines. Specifically I am training an agent using a PPO2 model.
My question is, are there some rules of thumb or best practices in network architecture (of actor and critic networks) to achieve higher performance i.e. larger rewards?
For example, I find that usually using wider layers (e.g. 256 rather than 128 units) and adding more layers (e.g. a deep network with 5 layers rather than 2) achieves a smaller RMSE (better performance) for time series prediction when training an LSTM. Would similar conventions apply to reinforcement learning - would adding more layers to the actor and critic network have higher performance - does sharing an input layer work well?


text:
Literature on Sequence Regresssion
I have some rated time-sequential data and I would like to test if an ANN can learn a correlation between my measurements and ratings.
I suspect I could just try a CNN where 1 Dimension is time or an LSTM/GRU and put the result through sigmoid, but is there any good literature on this? I have been trying to find information on datasets for the problem but it seems that Sequence regression is lacking any big official datasets, even though use-cases are there(e.g. learning personal music taste, try to predict rotten-tomato scores, etc..).
Looking for links to papers describing successful architectures or benchmarks where I can test my models.


text:
How is computed the gradient with respect to each output node from a loss value?
newbie here. I am studying the REINFORCE method in "Deep Reinforcement Learning Hands-On". I can't understand how, after computing the loss of the episode, that loss is backpropagated in a NN with multiple output nodes. To be more precise, in Supervised Learning, when we have multiple output nodes we know the loss of each of them, but in RL, how do we compute the loss of each output node (or maybe the partial derivative of the total loss with respect to each output layer)?
I hope to have been clear, thanks in advance.

You only backpropagate the gradient through the node for the action that you took at specific timestep in trajectory. You cannot backpropagate through the rest of the nodes because you cannot estimate the return for those other nodes and you cannot estimate return for them because you never took those actions.

@Brale_ Thanks for the help. This would make much sense, but if you check the example code here the loss function is computed for a whole minibatch and averaged, regardless of the node for the action we took, and then backpropagated to all the network. How does this work? And how can PyTorch compute such gradients with just the loss value?

I wouldn't exactly know since I didn't work with PyTorch, I would say that batch_actions_t holds all taken actions during trajectory, log_prob_v holds all action log probabilities calculated from the states encountered during trajectory. Then "correct" nodes for taken actions are extracted and that is then multiplied with returns which are calculated for all timesteps. Then they take the mean of that (to average the gradient) and backward method does it's automatic differentiation magic that I can't really explain. That would be my rough guess.

That's the point. I want to know the math behind the magic. How is the gradient of the loss with respect to the output of each output neuron computed?

like I said you only compute for the node of the action that you took. It's too long to discuss further in the comments read chapter 13 of this book. This is only a draft, if you can find full book even better.


text:
How is REINFORCE used instead of Backpropagation?
In neural networks with stochastic layers I've seen the use of the REINFORCE estimator for estimating the gradient (because it can't be computed directly).
Some such examples are Show, Attend and Tell, Recurrent models of visual attention and Multiple Object Recognition with Visual Attention.
However, I haven't figured out how this exactly works. How do we "bypass" the gradient's computation by using the REINFORCE learning rule? Does anyone have any insight on this?

REINFORCE is called a gradient estimator because it doesn't work on the true gradient, that comes from a loss function and the whole data, but makes up a heuristic loss, so that the gradient it ends up with isn't the true one. Let's see that with the REINFORCE equation:
$$
{\huge
\Delta \mathbf{\theta}_t = \alpha \nabla_{\mathbf{\theta}} \log \pi_{\mathbf{\theta}} (a_t \mid s_t) v_t
}%
$$
As this shows, the gradient is still there ($\nabla_\theta$). But the policy corresponds to the network's output, so we can use backpropagation to compute the gradient of that heuristic loss with respect to the weights. The real gradient is unknown to us, but this estimation will do the job.

I have a general understanding how policy gradient methods work, however this case is a bit different. First of all this is a supervised setting, i.e. we know the true loss at every step. What we can't compute though is the gradients of the parameters w.r.t the loss, due to the stochastic nature of the network. This is where the claim to use REINFORCE as a gradient estimator. I don't understand how, though...

Ok. This shows me that I haven't explained myself well. The funny thing is that, with REINFORCE, you don't bypass the gradient computation (backpropagation), but the need of having a supervised loss. What you have in a RL scenario is a reward signal and usually very sparse. I'll try to make the answer clearer.

I think it would be useful to explain the terms of the REINFORCE rule and why they are needed with respect to the question.


text:
Camera pose to environment Mapping
I would like to teach a model the environment of a room. I'm doing so by mapping a camera pose (x, y, z, q0, q1, q2, q3) to its corresponding image; where x, y, z represent location in Cartesian coordinates and qn represent quaternion orientation. I have tried numerous decoder architectures but I get blurry results with little or no details; as can be seen from the images below:

I am using Adam optimizer with a learning rate of 0.0001, and my network architecture is as follows:

ReLU(fc(7, 2048))
ReLU(fc_residual_block(2048, 2048))
ReLU(fc_residual_block(2048, 2048))
Reshape
ReLU(ConvTransposed2D(in=128, out=128, filter_size=3, stride=2))
ReLU(ConvTransposed2D(in=128, out=128, filter_size=3, stride=2))
ReLU(ConvTransposed2D(in=128, out=128, filter_size=3, stride=2))
ReLU(ConvTransposed2D(in=128, out=128, filter_size=3, stride=2))
ReLU(ConvTransposed2D(in=128, out=1, filter_size=3, stride=2))

I have tried different learning rates, loss functions(MSE, SSIM) and even batch normalization. Is there something that I'm missing here?


text:
A NN based model of a Cattle for 'Heat Detection'
I am very new to AI/ML but have lot of interest in these. I am trying to understand how this gadget works.

So far I have understood that a NN model of the cattle is generated by offline classification of the tagged data which is received from the wearable sensor. Consequently some ML algorithms are used to generate a model of a cattle.
That model is then embedded in the programmable wearable device. The device then sends the real-time tagged (classified, parameterized) data to the server.
Now I am looking for a sample NN-model of a cattle. I wonder how does a NN-model of a cattle would look like?

It's an old question and so far no answer to it. Does it mean that NN models for cattle are not possible?


text:
What do the numbers in this CNN architecture stand for?
So I've got a neural net model (ResNet-18) and made a diagram according to the literature (https://arxiv.org/abs/1512.03385).
I think I understand most of the format of the convolutional layers:
filter dims ,conv, unknown number ,stride(if applicable)
What does the number after 'conv' in the convolutional layers indicate? is it the number of neurons in the layer?

bonus q: this is being used for unsupervised learning of images, i.e the embedding output a network produces for an image is used for clustering. Would this make it incorrect for my architecture to have an FC layer at the end (which would be used for classifcation)?

This number refers to the number of kernels (or feature maps) that are convolved with the input. So, for example, in the first convolutional layer, $64$ $3 \times 3$ kernels are convolved with the image.
The ResNet presented in Deep Residual Learning for Image Recognition is used for image classification. Furthermore, note that your diagram already contains a fully connected layer at the end.

Are those all distinct kernels or is that the total number of convolutions that a particular 3x3 filter must perform when passed over all the pixels in an image? I added the FC layer at the end because I copied the format of their model, however mine isn't used for classification so should I remove the FC layer and possibly the average pooling?

@thatsnotmyname71 The kernels in a CNN are learned, so they will likely all be distinct. What do you mean by the embedding output a network produces for an image? Maybe you could ask a separate question (in a separate post) with more details regarding your specific problem.

ahh, thank you, I understand the kernels now. The network is used for unsupervised learning, so an output embedding for image triplets (which allows the use of a loss function encouraging embeddings which separate the 'anchor' image from its 'distant' image. The concept comes from Tile2Vec/Word2Vec (https://arxiv.org/abs/1805.02855).

@thatsnotmyname71 I will have to read your linked paper before trying to give you an appropriate answer.


text:
Alpha Zero queen promotion
"The final 9 planes encode possible underpromotions for pawn moves or captures in two possible diagonals, to knight, bishop or rook  respectively.   Other  pawn  moves  or  captures  from  the  seventh  rank  are  promoted  to  a queen."
Doesn't this mean that the network does not know that it can promote to a queen?

It means that there is no explicit coding of action choices to promote to queen, it is the default assumption if the underpromotion actions are not taken.
The Alpha Zero chess implementation can represent promotion to queen by not selecting an underpromotion action, whilst moving a pawn so that it qualifies for promotion.


text:
LSTM in reinforcement learning
Please tell me that is the LSTM network for the problem of reinforcement learning, as I explain to her what she will get the reward of a prediction, because the output will contain only actions?
Well, well, let's say at first I can play and upload my actions to training so that she sees which actions are right, that is, which she should strive for, but how to make her learn relatively independently?

Hi Alex and welcome to this community! We're glad to help. However, it is not clear what you're asking. Can you please write your question clearly in your native language and then use e.g. https://www.deepl.com/translator or Google Translate to translate your question to English, then edit your current post with that translation?

Also useful to translate, re-translate back, then re-retranslate to determine how much of the content is being translated accurately.

You can use LSTM in reinforcement learning, of course. You don't give actions to the agent, it doesn't work like that.
The agent give actions to your MDP and you must return proper reward in order to teach the agent. For example if you implement trading bot, the policy(policy=the agent, which is your LSTM network) will say that at step T it is going to have action 34, which means something to your MDP and you return reward for example -0.03 or +0.05 or whatever depending what that actions is doing at the moment T.
So I get the question like you want to do a supervised learning on a reinforcement learning environment.
You can mimic supervised learning as well, but the idea of reinforcement learning is not that.
Here is how to mimic:
Scenario: you are at step T, lets say you have 3 possible actions -1,0,+1;
In a supervised learning you must give the desired action to the learning process.
In reinforcement learning you must give reward based on if you are happy or not from the agent's action.
So you must have predefined that for -1 you are not happy and you give reward 0.0, for action 0 you are not happy and you give reward 0.0 and for action +1 you are happy and you give reward +100;
I hope this makes things clear.

Here's a question on your penultimate paragraph, I can't understand one thing, lstm gives out 3 actions, and how to me reward to give the neural network, the fourth output parameter or something?

Its not that simple. You need a framework that makes everything for you. Otherwise you will need to reinvent the wheel. First value of the output is called "value" and should be with activation "identity" function. This is how the reinforcement learning works. Sometimes it can be made of many networks, not just one. I use computational graph from dl4j framework. Many reinforcement learning introduce the notion of value-function which often denoted as V(s) . The value function represent how good is a state for an agent to be in.

I see you are interested in keras and python. Take a look at this framework :https://github.com/keras-rl/  and the answer to your question is at this row, look how the author has put first output as V(s;theta) and then comes all the actions as one hot vector: https://github.com/keras-rl/keras-rl/blob/master/rl/agents/dqn.py#L122


text:
Reinforcement learning: How to deal with illegal actions?
I'm a beginner of RL and currently trying to make DQN agent that can act optimally in a simple situation.
In the situation agent should decide at what rate to charge or discharge the electrical battery, which is equivalent to buying the electrical energy or selling it, for making money by means of arbitrage. So the action space is for example [-6, -4, -2, 0, 2, 4, 6]kW. The negative numbers mean discharging, and the positive numbers mean charging.
In a case that battery is empty, discharging actions(-6, -4, -2) should be forbidden.
Otherwise in a case that battery is fully charged, charging actions(2, 4, 6) should be forbidden.
To deal with this issue, I tried two approaches:

In every step, renewing the action space, which means masking the forbidden action.
Give extreme penalties for selecting forbidden actions (in my case the penalty was -9999)

But none of them worked.
For the first approach, the training curve (the cumulative rewards) didn't converge.
For the second approach, the training curve converged, but the charging/discharging results are not reasonable (almost random results).
I think in second approach, a lot of forbidden actions are selected randomly by the epsilon-greedy policy, and these samples are stored in experience memory, which negatively affect the result.
for example:
The state is defined as [p_t, e_t] where p_t is the market price for selling (discharging) the battery, and e_t is the amount of energy left in the battery.
When state = [p_t, e_t = 0], and discharging action (-6), which is forbidden action in this state, is selected, the next state is [p_t, e_t = -6]. And then the next action (2) is selected, then the next state is [p_t, e_t = -4] and so on.
In this case the < s, a, r, s' > samples  are:
< [p_t, 0], -6, -9999, [p_t+1, -6] >
< [p_t, -6], 2, -9999, [p_t+1, -4] > ...
These are not expected to be stored in the experience memory because they are not desired samples (e_t should be more than zero). I think this is why desired results didn't come out.
So what should I do? Please help.

ignoring forbidden actions is the right approach, only consider the allowed actions at specific timestep.

I would ignore forbidding actions (e.g. act like 0) in your environment (simulator), since - for as far I understood - they cause the system to be in an invalid state. Nevertheless, you probably also should put a (small) negative reward for those actions.

In my project I also had the problem that the action space is not the same for every state of the environment. I do not like the approach to penalty forbidden actions with a high negative reward since it feels a bit like cheating. However it might work, I just haven't tried it.
The approach I used, which you could apply as well, is to integrate an additional function into your action space. This function would map an action to a specific amount of kW. Thereby, depending on the current state, the function maps the action to the amount of kW to charge or discharge your battery with. This has the advantage that you do not have to deal with illegal actions.
This could be applied as follows:
Instead of defining for every action the amount to charge / discharge your battery with, you create a set of functions that defines the respective amount. Here an example with five actions:

Action: Discharge the battery entirely
Action. Discharge the battery so that half of its capacity remains,
otherwise do nothing
Action: do nothing
Action: charge the batter to half its capacity, otherwise do nothing
Action: charge the battery to its maximum capacity

You can set the number of output nodes to the number of all actions, then choose the highest output value, try to do that action, if it can't, move to the next highest output value and so on. The only problem with this is that you have to know how many possible actions there are


text:
Super Resolution CNN generates black dots on output images
I have been trying to train a CNN for the super-resolution task based on the work of Dong et al., 2015 [1]. The network structure built in PyTorch is as follows:
  (0): Conv2d(1, 64, kernel_size=(9, 9), stride=(1, 1), padding=(4, 4))
  (1): ReLU()
  (2): Conv2d(64, 32, kernel_size=(1, 1), stride=(1, 1))
  (3): ReLU()
  (4): Conv2d(32, 1, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))

I have a training dataset which consists of approximately 22.000 sub-images generated from 91 images and training is performed only on the Y channel of the images in YCbCr color space. During the training process, I used RMSE loss and calculated the PSNR (Peak Signal to Noise Ratio) from that loss. I observed that PSNR value is increasing as a result of decreasing loss as expected and as depicted in the figure.

I trained the network for 25 epochs. After 10th epoch, the network is converged and PSNR value started to increase slowly. After this point, I was expecting to get even better visual outputs with higher PSNR values achieved. However, when I analyze the results of the network, there are some black pixels appearing in white spots in the output images that the network produced.

After 25-epoch training was completed, I compared the outcome of 25th epoch (right) with that of 10th epoch (left) as you can see in the figure above.
What might be the possible reasons for the undesired black pixels and the possible precautions that can be embedded into the network to get rid of these?
If you would like to check my code, you can visit here.
[1] Dong, Chao, Chen Change Loy, Kaiming He, and Xiaoou Tang. "Image Super-Resolution Using Deep Convolutional Networks." IEEE Transactions on Pattern Analysis and Machine Intelligence 38, no. 2 (2015): 295-307. doi:10.1109/tpami.2015.2439281.

I met the similar problem like you proposed. Do you solve it later? Look forward to your help. Thanks.

@吴沛阳 unfortunately, still don't know how to solve it.

How about white dot?

This is a while ago, but still this problem might occur to someone.
I encountered the same problem and found that the reason was how the resulting tensors are transformed to images. It seams that pixels with value 1.0 are shown as white while pixels with values bigger than 1.0 are interpreted as being black sometimes.
So adding (in PyTorch)
indices = tensor > 1.0
tensor[indices] = 1.0

before converting to the image in the visualization method fixed the problem for me.

Do you remember which layer in neural network? Was it some tensor in the last layer? Also which Super Resolution method (list at https://github.com/LoSealL/VideoSuperResolution#network-list-and-reference-updating)?

It was not in a layer at all in that sense. The Network outputs values that are mostly between 1 and 0. But sometimes these values are slightly over 1 or under 0 if no activation function is used after the last layer (e. g. no sigmoid) . So the network gives a value whiter than white so to say. Independent of the super resolution method this might always happen without activation function. However, some visualization packets show values bigger than 1 as black. So you might fix that by clipping the values between 0 and 1 before visualization. Hope that clarifies things.

"But sometimes these values are slightly over 1 or under 0 (at the last layer without activation function)"...doesn't it apply to specific neural network model? I thought the last layer of most CNN implement models is a dense layer. Do you mean the layer before activation in the middle?

No, I mean the last layer, which can also be a Convolutional Layer, depending on the architecture. But also a dense layer can output values that are not in the range between 0 and 1.

Great that a solution was found (clamp larger-than-one pixels' brightness before showing the image). But I suggest that you either add a sigmoid activation, or clamp the network's output directly from zero to one. This way the plotting code doesn't need to handle out-of-spec values, and in theory the model can achieve a bit smaller loss. It doesn't need try to predict exactly 1.0 or 0.0, but values like 2.3 and -0.5 are ok since they get clipped to the correct values (assuming that clipping, not sigmoid is used).
Sigmoid has a bit nicer gradients than hard clipping, if the model overshoots predictions and the target value is for example 0.9 or 0.1.


text:
Is AI and Big Data science recommending a shift in the scientific method from inductive to deductive reasoning?
Is this true?  Are we planning to switching such reasoning methods regarding AI tech in the future?

You could argue that AI and big data are trying to switch the AI method from deductive to inductive reasoning in the sense that original AI was deductive (if...then conditionals) but deep learning implies inductive reasoning (feed the network a million images of white swans and the network will "conclude" all swans are white - the classic example of (erroneous) inductive reasoning.)


text:
Is there an standard algorithm for giving options from an RNN?
You can feed books to an RNN and it learn how to produce text.
What I'm interested in is an algorithm that, given say 20 letters it suggest, say the best 10 options for the next 10 letters.
So for example it begins with "The cat jumped "
and then we get various options such as "over the dog". "on the table" and so on.
My initial thoughts are to first use the most likely next letters. Then find the letter which is most uncertain and change this to the second likely next letter. And repeat this process.
(Then I may have another evaluation neural network to assess which is "best" English.)
In other words I want the RNN to "think ahead" at what it's saying - much like a chess playing machine.

I'd recommend going through the CBOW-based word2vec, which pretty much does the same thing: https://israelg99.github.io/2017-03-23-Word2Vec-Explained/

you mention neural text generations which work off of sampling (so just sample 10x) or find 10 most likely


text:
Suggestions for Deep Learning for regression on huge 3D volumes
I have a dataset of 3D images (volumes) with dimensions 400x250x400. For each input image I have an output of the same dimensions. I would like to train a machine learning (or deep learning) model on this data in order to predict values with new data.
My main problems are :
Images are very big, which leads to memory issues (tried with an NVIDIA 2080Ti and doesn't fit on memory during training)
I need a very fast inference, because the model will be used on real time(speed is a requirment)
I already have experience with architectures such as 3D Unet using Keras with tensorflow backend, but it didn't worked for me because of the previous reasons, even with very few layers and convolution filters.
I know that one of the first solutions that one could imagine, is to reduce resolution of the volumes, but in my case I'm not allowed this because I would lose a lot of spatial information.
Any ideas or suggestions ? Maybe Neural Nets are not the best solution ? If not, what could I use ?
Thank you very much for your suggestions

If you are forced to use 400x250x400 as input and output, then your options may be limited, as that is guaranteed 40M parameters and 40M outputs. It may help to describe more about your problem - what these represent, what the goal of training is, how you are measuring success at the task (e.g. is it a basic regression with MSE, a classification etc), what the purpose is. The hope is that you are working with a very small manifold compared to the 40M dimensions of your raw data, and can somehow take advantage of that - if not, then it is unlikely that any ML will help

If you require that you keep this full resolution you won't find a prediction that works in real-time. Context is important though, it may well be you could flatten each image to a 2d plane and input that data or take only a small area of the 3d model but without knowing what we're dealing with I can't suggest anything beyond you trying to shrink your input down.


text:
Developmental systems that try to explain or understand the reward value in the reinforcement learning?
Are there methods (possibly logical or (how they are called in the literature) relational) that allows for the developmental systems to understand or explain the value of the received reward during the developmental process. E.g. if the system (agent) can understand that reward is by the chance, then it should be processed quite differently than the reward that is just initial downpayment for the expected series of rewards. Credit assignment is the one method (especially for delayed rewards), but maybe there are different methods as well?
Relational reinforcement learning allows to learn symbolic transition and reward functions and emerging understanding of the reward by the agent can greatly facilitate the inner consciousness of the agent and the search process for the best transition and reward functions (symbolic search space can be enormous).

Please define or give at least an example of "trying to explain". Meta-explanation is still a research topic. J.Pitrat's blog could give some interesting insights about it.

By "trying to explain" I mean that the system (agent) have some kind of function (reward value, current state of environment) => ((state, action)=>(reward), whether and how to update the transition, reward function), i.e. function that observer the state and reward value and tries to explicitly model the environment and modeling is done by specifying and updating function.

That should go into your question*


text:
CNN - Visualizing images near decision boundary - Pixels inexplicably tend to edges
We are exploring the images classified by a CNN at its decision boundary, using Genetic Algorithms to generate them. We have created a fine-tuned binary grayscale image classifier for cats. As the base model, we are using an Inception-ResNet v2 pre-trained on the ImageNet dataset, and then fine-tune it with a subset of cat and non-cat images (grayscale) from ImageNet. The model achieves ~97% accuracy for a test set.
We have constrained the problem such that evolution starts from a pure white image, and random crossover and mutations are performed with only black pixels. Crossover and mutation probabilities are kept at 0.8 and 0.015 respectively.
As an incentive to generate a "cat" with the minimum number of black pixels, I add a penalty for the black pixel count in the image. The initial population is a set of 100 white images that have a single random pixel coloured black in them.
The evolution generates images with only black and white pixels, and we have a fitness function that is taken as a linear transformation of loss calculated between target label and network prediction as follows;

loss = binary cross entropy (target, prediction) + λ(# of black pixels)

Target value (y)    = target label cat - in this case, 0.
λ                              = hyperparameter to weight the penalty for black pixel count.
Problem
My problem is that across multiple runs of evolution, all images classified as cats tend to have black pixels towards the edges of the image. Below is an example.

This image is classified as a cat with over 96% confidence.
I have tried different crossover mechanisms including

Random rectangular area swap between parents
Alternating column interchange
Direct black pixel crossover after encoding the image to
a reduced form that only kept track of the black pixels (black pixel
list is the genome)

Initially, we ran evolution with a similarly fine-tuned VGG-16 model, and then moved to the Inception ResNet due to better accuracy. Pixels tend to edges across models and crossover mechanisms.
In one run, I explicitly constrained the evolution to perform mutations in the middle section of the images for 3,000 generations before lifting this restriction. But the images generated after that point always had better scores.
We are at a loss as to why the images never have pixels coloured in the middle.
Does anyone have any ideas on this?


text:
How to use machine learning to create combine of opposite images side by side
Inspired by: Two Worlds Pictures

I just want to create a Machine Learning Model that can automatically combine the opposite images into 1 image.
I am thinking about 2 possible solutions:

Pose Estimation: Detect humans and their poses from image data and search an archive by pose, but totally out of context.
Land Lines: explore similar lines.

It's just my ideas, do you have any recommendations?
Thanks


text:
Alphazero Value loss doesn't decrease
Currenly I'm trying to reimplement alphazero in pure c++ using libtorch to accomodate my project's need. But when I training my model, I found out that the value loss doesn't decrese at all after even ~2000 iterations and the policy loss decreases pretty fast from the very begining.
Have anybody met any similar issue when developing your alphazero project? And could you give some suggestion of the cause of my issue based on your experience?
Many apreciates


text:
Can mAP score be used to describe "recall" rate of a model?
I have a general question regarding the mAP score used in measuring object detection system performance.
I understood how the AP score is calculated, by averaging precision over recall 0 to 1. And then we can compute mAP, by averaging AP score of different labels.
However, what I have been really confused, is that, it seems that mAP score is used to denote the "precision" of a model. Then what about the "recall" aspect? Note that generally speaking, when measuring the performance of a machine learning model, we need to report precision and recall at the same time, right? It seems that mAP can only cover the precision aspect of a model.
Am I missed anything here? Or mAP score, despite its name is derived from Precision, can indeed subsume both "precision" and "recall" and therefore become comprehensive enough?

average precision is relative to recall, its says something about the precision recall give/take.

@mshlis. Thanks for the clarification. Yes, that's what I can think about.. But is there any more "formal" description/statement such that "mAP is derived from both precision or recall"?

Look at F score

@mshlis Yes, I understood the definition of F score, but what's the relation with mAP?

@mshlis OK, I think I found what I am looking for. What I can say is that "mAP derieves from both precision and recall values, by computing the area under the precision-recall curve for a given class." In that sense, yes, it surely subsumes both precision and recall values in a way.


text:
Is normalizing the data a way to improve generalization?
There are many known ways to overcome overfitting or make a model generalize better to unseen data.
Here I would like to ask if normalizing/standardizing/similiraizing the train and test data is a plausible approach.
By similarizing I mean making the images look alike by using some function that could be a Neural Network itself. I know that normally one would approach this the opposite way by augmenting and therefore increasing the variation in the training data. But is also possible to improve the model by restricting the variation of the training and test data?
I know that this may not be the best approach and maybe too complicated but I see some use cases where known techniques of preventing overfitting aren't applicable. In those cases, having a network that can normalize/standardize/similarize the "style" of different images could be very useful.
Unfortunately I didn't find a single paper discussing this approach.

Batch Normalization is usually known to speed up the learning process as it makes the weights in the deeper layers more robust. It restricts the distribution of the weights in a particular layer - this video might tend to be useful to what BatchNorm does. This said, batch normalization does have a regularizing effect which does to tend to increase generalization.
Talking about generalization - A focus on regularization would probably be more helpful


text:
3D geometry and similarity with a reference model
I am looking for a CNN method, or any other machine learning method, to recognize 3D natural geometries that are similar to each others, and compare these geometries with a reference 3D model. To illustrate this, consider the following crater topographic map (x,y,z) of the Moon as an example:

The exercise would be to recognize the craters, and compare their (3D) geometry (scale-invariant) with a reference 3D crater model (e.g. the one within the blue square). The result I am looking for is a kind of heatmap showing the similarity measure of (1) a sampled crater with the crater model, and/or (2) the geometry of some parts of the sampled crater (e.g. the inner crater steep sides) with those of the reference model. No classification.
I tend to think that a 3D-oriented CNN method (OctNet, Octree CNN... etc) is a starting point for the above-mentioned task but I would rather prefer getting opinions on this matter since I am still a newbie in machine learning and we are dealing with direct application to real-world natural objects here.


text:
Turn photos right-side up?
I'm looking for either an existing AI app or a pre-trained NN that will tell me if a photograph is right-side up or not. I want to use this to create an application that automatically rotates photos so they are right-side-up. This doesn't seem hard.
If it doesn't exist, presumably I can create it with Tensorflow, and just use a ton of photos to train it, and assume they are all correctly oriented in the training set. Would that work?

Yeh I would be surprised if it didn't. Use softmax on the output and cross-entropy loss. You have the option of either using a pre-trained network, then cutting out the final layer and replacing it with 2 output nodes (right side up/not) and do a bit more training, or just train it from scratch, given the simplicity of this task I would think either case should work. You also shouldn't really need a big network to do this.

I don't know if there is an existing pretrained NN that does this but it wouldn't be very hard to modify one to do this.
First, I'd take a pretrained image classification NN (e.g. VGG, ResNet), drop its final layer and replace it with one with 4 neurons, representing the 4 orientations (so that you know which way to rotate it).
Then I'd take again a dataset of regular images (e.g. a subset of ImageNet) and assume that they are correctly oriented. I'd make three more duplicate datasets with the same images rotates by 90, 180 and 270 degrees respectively. These 4 datasets would be the 4 classes I'd fine tune the model on.
By training your model on this dataset, you'll be training it to recognize which side your image is facing. Since it's a pretrained net and its a fairly simple task, I think that after a few iterations, your model will have converged. Then you could write a script that uses this model to predict an image's orientation and rotate it accordingly.


text:
Loss reduction, but constant performance with CNN
I made a CNN with a reasonable loss curve, but the performance of the model does not improve. I have tried making the model larger, I am using three convolutional layers with batch norms.
Thanks for your help.

Hi. You need to give more details regarding your problem. You also need to be more specific regarding your illustrations.


text:
How to implement SVM algorithm from scratch in a programming language?
I'm a computer scientist who's studying support vector machines (SVMs) in a machine learning course. I have some understanding of how SVMs are designed, thanks to 16. Learning: Support Vector Machines - MIT. However, what I'm not understanding is the transition from the optimization problem of the Lagrangian function to its implementation in any programming language. Basically, what I need to understand is how to build, from scratch, the decision function, given a training set. In particular, how do I find Lagrange multipliers in order to know which points are to be considered to define support vectors and the decision function?
Can anyone explain this to me?

We're you ever able to answer your question because I have arrived at a similar point?

Based on this repository:
https://github.com/arkm97/svm-from-scratch/blob/master/SVM_from_scratch.ipynb
I will try to reverse engineering that concept:
So firstly there is issue for DataCleaning(removing 0,values, serialize, normalize)
normalizing dataset (replaced by its difference from the mean)
credit_df_norm = (credit_df - credit_df.mean())/(credit_df.std())

Divide dataset into Train & Test:
train_df = credit_df_norm.drop(target, axis=1).loc[:training_points]
train_target = credit_df_norm[target].replace(0, -1).loc[:training_points]

And here is starting the clue of that algorithms (with maths etc.)

given data points $\vec x_j \in \mathbb{R}^{1 \times N}$ and targets
$y_j = \pm 1$, where $j = 1, \dots, M$, find the maximum-margin
hyperplane that separates the two classes ($y_j = 1$ and $y_j = -1$).
Let $\vec w$ be the vector normal to the hyperplane. We want to find
$\vec w$ that satisfies
$$ y_j (\vec w \cdot \vec x_j + b) \geq 1 $$ The dual formulation of
the above is equivalent to maximizing the following over the
multipliers $\vec \alpha$:
$$ L(\vec \alpha) = \vec y \cdot \vec \alpha  - \frac 1 2  \vec \alpha
> K \vec \alpha^T$$ subject to the constraints $\sum_{j=1}^M \alpha_j =
> 0$ and $y_j \alpha_j \geq 0$. The matrix $K$ defines the kernel of the
SVM; I've chosen $K_{jk} = k(\vec x_j, \vec x_k) = \vec x_j \cdot \vec
> x_k$. The parameters of the plane are recovered from $\vec w = \vec
> \alpha \cdot \vec x$ and $b = y_j = \vec w \cdot \alpha_j$ for $j$
such that $\alpha_j \neq 0$

Let's divide it to the single factors:
we need to find maximum-margin-hyperplane for separate into two classes:
Separation cause SVN is classification - so we need to classify elements into categories.
 = 1
 = −1
This pattern allow to find hyperplane(?)
(⃗ ⋅⃗ +)≥1
The next pattern:
(⃗ )=⃗ ⋅⃗ −12⃗ >⃗
The author for kernel SVN choose those pattern:
=(⃗ ,⃗ )=⃗ ⋅>⃗
And the parameters for plane are here:
⃗ =>⃗ ⋅⃗  and ==⃗ ⋅ for  such that ≠0
Reference:
https://arxiv.org/pdf/1307.0471.pdf

In this line are added the kernel
Popular kernels are:

Polynomial Kernel,

Gaussian Kernel,

Radial Basis Function (RBF),

Laplace RBF Kernel,

Sigmoid Kernel,

Anove RBF Kernel
k_value = np.array(train_df @ train_df.T + np.identity(len(train_target))*1e-12)

The structure of k_value (kernel matrix) is an array.

Next there is use of cholesky decomposition—cholesky - which is next complicated concept.
np.linalg.cholesky(k_value)

Next some bits of data converting:
alpha = cp.Variable(shape=train_target.shape)
beta = cp.multiply(alpha, train_target) # to simplify notation
K = cp.Parameter(shape=k_value.shape, PSD=True, value=k_value)

# objective function
obj = .5 * cp.quad_form(beta, K) - np.ones(alpha.shape).T @ alpha

# constraints
const = [np.array(train_target.T) @ alpha == 0,
        -alpha <= np.zeros(alpha.shape),
        alpha <= 10*np.ones(shape=alpha.shape)]
prob = cp.Problem(cp.Minimize(obj), const)

The next step is recreate the hyperplane:
w = np.multiply(train_target, alpha.value).T @ train_df
S = (alpha.value > 1e-4).flatten()
b = train_target[S] - train_df[S] @ w
b = b[0]
# b = np.mean(b)

And finally - the classification and evaluation:
def classify(x):
    result = w @ x + b
    return np.sign(result)

correct = 0
incorrect = 0
validation_set = credit_df_norm.drop(target, axis=1)
predictions = []
for i, x in validation_set.iterrows():
    my_svm = classify(x)
    if my_svm==credit_df_norm[target].replace(0, -1)[i]: correct +=1
    else: incorrect +=1
    predictions.append(my_svm)
predictions = np.array(predictions)

print(f"fraction correct: {correct/(correct + incorrect)}")

That was the more detailed implementation - for shorcut there is an interesting article:
https://towardsdatascience.com/svm-and-kernel-svm-fed02bef1200
There are existing function from another library - that can be reused in simple manner:
# Fitting SVM to the Training set
from sklearn.svm import SVC
classifier = SVC(kernel = 'rbf', C = 0.1, gamma = 0.1)
classifier.fit(X_train, y_train)

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats

# use seaborn plotting defaults
import seaborn as sns; sns.set()

Visualized Dataset:

Dataset after apply hyperplanes:


text:
How does InfoGAN learn latent categorical codes on MNIST
While reading the InfoGAN paper and implement it taking help from a previous implementation, I'm having some difficulty understanding how it learns the discrete categorical code when trained on MNIST.
The implementation we tried to follow uses a target as a randomly generated integer from 0 to 9. My doubt is this: how can it learn categorical information if from the start it's learning using a loss which takes in random values.
If this implementation is wrong, then what should the target be while training the Q network, when using the categorical-cross-entropy loss on the output logits?


text:
Video engagement analysis with deep learning
I am trying to rank video scenes/frames based on how appealing they are for a viewer. Basically, how "interesting" or "attractive" a scene inside a video can be for a viewer. My final goal is to generate say a 10-second short summary given a video as input, such as those seen on Youtube when you hover your mouse on a video.
I previously asked a similar question here. But the "aesthetics" model is good for ranking artistic images, not good for frames of videos. So it was failing. I need a score based on "engagement for general audience". Basically, which scenes/frames of video will drive more clicks, likes, and shares when selected as a thumbnail.
Do we have an available deep-learning model or a prototype doing that? A ready-to-use prototype/model that I can test as opposed to a paper that I need to implement myself. Paper is fine as long as the code is open-source. I'm new and can't yet write a code given a paper.

In your model, are you looking for an accurate summary, or want to maximise interest (whilst still limiting output to an edit from the referenced video)? The two goals are often not compatible, witness any film trailer, YouTube "clickbait" etc. I am asking because I think I have seen references to work on the goal of generating accurate summaries, and might be able to find something. But that doesn't appear to be what you want?

Not really accurate summary, but to maximize interest. Yes, it's highly subjective. We don't know the best solution. We just need "a" solution! As long as a model is targeting that concept, it should be fine.

@NeilSlater Something like this: https://www.neonopen.org/ they claim their deep models find thumbnails that will drive more clicks, likes, and shares. But their codes are client/server based and not easy for me to run.

OK, I don't know that area well enough. So I was going to suggest things like https://github.com/Pratik08/vis-dss (although note GPL licensing, which may not suit a commercial product), which is geared around creating an accurate summary. It's an interesting area though, so I hope you find an answer. Sometimes accuracy is an attractive end goal of course, if for instance you were indexing video with the goal of helping an end user finding something that they were looking for

Thanks Neil. I will look into that repo. If anything came into mind within a short term, please let me know.

@NeilSlater Neil, did you try building the repo yourself?  cmake runs ok, but not the make.

No I have not tried building Vis-DSS

This strikes me as an extremely difficult problem due to the subjectivity of the response that you are trying to evaluate. At the very least, you would need to include the demographics of the viewer into the model.

One of the key terms in the literature that you are looking for is video captioning.
You can have a look at some of the relevant papers with code on this subject. In short, it is an active area of research and a difficult problem, one reason is because videos are still difficult to learn about (because of larger amount of data + larger model, etc...) and this model has to be working with two modalities of data: text and image.
A paper that you might want to start with is Deep Visual-Semantic Alignments for Generating Image Descriptions which works on single images. In short, you can use something similar like in the paper: object detector (e.g. Faster RCNN) to extract visual features and feed them into the state of an RNN (LSTM) which would output a sequence of words in your summary (see picture below).

Thanks. But how is video captioning related to video scoring? I like to know how a scene is interesting for a viewer.

Right, I focused on "generate say a 10-second short summary given a video as input". Yeah I see your problem. It sounds like a specific problem for which there wouldn't be a dataset available online (don't know at the top of my head). If you have an opportunity to create your own dataset then you can perform regression on your score directly. For example this paper: YouTube-8M performs video classification. Then instead of predicting a class you would predict a score (also changing the loss to l1 or l2 loss).

This is a useful answer for a different question, which is why I downvoted it.


text:
Image to image regression in tensorflow
I am working on an image to image regression task which requires me to develop a deep learning model that takes in a sequence of 5 images and return another image. The sequence of 5 images and the output images are conceptually and temporally related. In fact, the 5 images in the sequence each correspond to timestep in a simulation and the output, the one I am trying to predict, corresponds eventually to the 6th timestep of that sequence.
For now, I have been training a simple regression-type CNN model which takes in the sequence of 5 images stored in a list and outputs an image corresponding to the next timestep in the simulation.
However, I have been researching a bit now in order to find a better way to carry out this task and I found the idea of ConvLSTMs. However, I have seen these applied to the prediction of feature and the output of a sentence describing that image. What I wanted to know is whether ConvLSTMs can also output images, but more importantly if they can be applied to my case. If not, what other types of deep learning network can be suitable for this task?
Thanks in advance !