1
+ """
2
+ This module defines the structures for different models, including
3
+ CellBox, linear regression, and co-expression
4
+ """
5
+
1
6
import numpy as np
2
7
import tensorflow as tf
3
8
import pertbio .kernel
@@ -20,11 +25,9 @@ def factory(args):
20
25
# elif args.model == 'Bayesian':
21
26
# return BN(args).build()
22
27
# TODO: baysian model
23
-
24
- else :
25
- raise Exception ("Illegal model name. Choose from [{}]" .format (
26
- 'CellBox, CoExp, LinReg, NN, CoExp_nonlinear, Bayesian'
27
- ))
28
+ raise Exception ("Illegal model name. Choose from [{}]" .format (
29
+ 'CellBox, CoExp, LinReg, NN, CoExp_nonlinear, Bayesian'
30
+ ))
28
31
29
32
30
33
class PertBio :
@@ -142,7 +145,7 @@ def build(self):
142
145
143
146
144
147
class CoExpNonlinear (CoExp ):
145
-
148
+ """co-expression model with non-linear envelope"""
146
149
def get_variables (self ):
147
150
with tf .compat .v1 .variable_scope ("initialization" , reuse = True ):
148
151
Ws = tf .Variable (np .zeros ([self .args .n_x , self .args .n_x , self .n_x , self .n_x ]), dtype = tf .float32 )
@@ -166,6 +169,7 @@ def get_variables(self):
166
169
167
170
168
171
class LinReg (PertBio ):
172
+ """linear regression model"""
169
173
def get_variables (self ):
170
174
with tf .compat .v1 .variable_scope ("initialization" , reuse = True ):
171
175
self .params .update ({
0 commit comments