Training a neural net

I’m trying to train a neural net with weights, and I’ve
run into problems. I have two data sets, background and
signal, and I want to use a neural net to cut away the
background events from my experimental data set.

However, my signal events are weighted. In order to save
CPU time I have simulated more events with high energy
and in order to get a correct distribution the events need
to be unweighted.

How do I train the neural net correctly, accomodating the
signal event weights? I tried adding a weight when
initiating my TMultiLayerPerceptron, but then all events
are classified as signal. And if I manage to train the net
properly, how do I plot the result for the signal sample.

The macro I use to train the neural net, my two input data
files, and my shared library can be found at

physto.se/~christin/mlp/mlp.html

  • Christin Burgess

Hi Christin,

[quote=“cburgess”]However, my signal events are weighted. In order to save
CPU time I have simulated more events with high energy
and in order to get a correct distribution the events need
to be unweighted.[/quote]
Just a tiny comment here. It really depends on what you want; I assume the way you use weights corresponds to a physicists’ approach, folding xsection ratios back into an MC sample. This is not necessarily what you want to use when training.

As an example, you might want to train a NN which takes some rapidly falling variable as input. You’ve generated two MC samples, one for the low part, one for the higher one ('cause otherwise you’d have almost no entries in the higher part). Now using the physicist’s approach, one would weight the events from the higher part such that they represent the same integrated cross section as the lower part. This tells the NN that the important events are at low values, and that it should pretty much ignore the data points from the upper part. But this might not be what you want; instead settting the training weights to 1./xsection might give you a better performing NN, over the whole spectrum, by telling the NN “and don’t just ignore the higher part, only because there are almost no entries up there”.

[quote=“cburgess”]How do I train the neural net correctly, accomodating the
signal event weights? I tried adding a weight when
initiating my TMultiLayerPerceptron, but then all events
are classified as signal.[/quote]
Can you plot the weights, after filling them into your TTree* simu? I suspect that the signal weights are >>1, which means signal events are the only ones that count, so the NN decides “let’s just make everything signal”.

[quote=“cburgess”]And if I manage to train the net
properly, how do I plot the result for the signal sample.[/quote]
Just as you did, using ana.DrawNetwork(0,“type==1”,“type==0”); and signal->GetEntry(i);… sig->Fill(mlp->Evaluate(0,params)); Do you see a problem with those?

Axel.