Code Monkey home page Code Monkey logo

genet's Introduction

genet

Gene regulatory network inference with covariance dynamics

Install

You can install this package through pip

pip install git+https://github.com/zhengp0/genet.git

Example

After installed the package you can use the following code as an example.

import numpy as np
from genet.solver import RegRelSolver

# problem setup
# true solution of this problem should be all 0
n = 5
inv_kt = np.identity(n)
inv_k0 = np.identity(n)
lam = 0.0

# solve the problem
solver = RegRelSolver(inv_kt, inv_k0, lam)
regrel = solver.fit()

assert np.allclose(regrel, 0.0)

genet's People

Contributors

zhengp0 avatar

Watchers

 avatar

Forkers

uw-amo

genet's Issues

Directional penalization

Our solver currently is solving optimization problem
$$\min_{A} \frac{1}{2}\|K(t) - (I + A)K(0)(I + A^\top)\|^2 + \frac{\lambda}{2} \|A\|^2, \quad\mathrm{s.t.}~A_{i,j} = 0, \forall(i, j) \in \mathcal{I}$$
where, $\mathcal{I} = \{(i, j)| K(t)^{-1}_{i,j} = 0, K(0)^{-1}_{i,j} = 0\}$.
Since $K(t)$ and $K(0)$ are variance covariance matrices, the mask $\mathcal{I}$ is symmetric. However in the application we are interested in, we want either $A_{i, j} \ne 0$ or $A_{j, i} \ne 0$. Therefore we need additional penalization on top of current mask.

Potential solution:
Here we propose to use trimmed $\ell_1$ regularizer, follow the work at
http://proceedings.mlr.press/v97/yun19a/yun19a.pdf
And we change the objective to
$$\min_{A,w} \frac{1}{2}\|K(t) - (I + A)K(0)(I + A^\top)\|^2 + \frac{\lambda}{2} \|A\|^2 + \tau\sum_{(i, j) \in \mathcal{\bar I}_{--}} (w_{i,j} |A_{i, j}| + (1 - w_{i, j})|A_{j, i}|)$$
and we have the constraints
$$A_{i,j} = 0, \forall(i, j) \in \mathcal{I},~\text{and}~w_{i, j}\in[0,1], \forall (i, j)\in\mathcal{\bar I}_{--}$$
where $\mathcal{\bar I}_{--} = \{(i, j)|i < j, K(t)^{-1}_{i,j} \ne 0~\mathrm{or}~K(0)^{-1}_{i,j} \ne 0\}$.

In this case, we hope $w_{i,j}$ will reach to $0$ or $1$ and we will only penalize $A_{i,j}$ or $A_{j,i}$ with $\ell_1$ norm and bring it to zero.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.