# Weights from neural network as interaction score between pairs

The question is using genes as example but I thought “Machine Learning” section is more suitable for this question. Because the concept is independent from genes, might be applicable to other domains.

Suppose we have many genes and there are interactions between them, e.g. one gene activating several genes, another gene repressing couple of genes. Ideally, the best experiment to reveal those interactions would be “reverse engineering” by changing expression level of one gene and then observe changes in other genes by time. But these type of data is scarce, however there are tons of data for steady-state expression levels (i.e snapshot of gene expression profile for a given condition). For example, suppose geneA is activating geneD then we expect following scenario; expression level of geneD is correlated with geneA expression level as shown below (I kept expression of other genes steady for argument’s sake):

experiment1 experiment2 experiment3
geneA 10 100 20
geneB 100 110 100
geneC 5000 6000 6000
geneD 500 4500 750
geneE 900 910 900

When we extend this approach to many genes and many experiments then it’s possible to discover pairs of genes that carry positive or negative regulation. Our interest is to reveal gene interactions using steady-state data. Obvious option is neural networks, and there are couple of examples in literature:

• In one study, 15 genes were used, they are using double loop to iterate over all possible gene-gene pairs and for each pair they do another loop (n=1000) where weights are adjusted until error is less than 0.001 link
• In another study they mention even MLP but Figure 1 shows multiple nested loops

I was planning to use Flux with simple MLP approach but the examples in literature is different from classical MLP approach. They implement double loop, both iterate over genes spanning all possible gene-gene pairs. At each step loss is calculated, weights are adjusted. This should be equivalent to matrix multiplication but I had hard time to implement it with classical MLP with available data. By classical MLP, I mean:

``````@epochs args.epochs Flux.train!(loss, params(m), train_data, opt, cb = evalcb)
``````

How can I use Flux to train a NN after which the weights will indicate interaction strength?