Module Import alias identifier Import alias Import alias identifier FunctionDef arguments args NameParam NameParam defaults NameLoad body If CompareEq NameLoad Num body If CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr Num body Return Call AttributeLoad NameLoad attr TupleLoad Num Num Return UnaryOpUSub Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad While CompareNotEq Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body If CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num body Assign SubscriptStore NameLoad ExtSlice Slice Index ListLoad Num Num SubscriptLoad NameLoad ExtSlice Slice Index ListLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore BinOpSub Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr CompareLt NameLoad Num Num NameLoad Assign NameStore BinOpSub BinOpSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr CompareLt NameLoad Num NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Num Num Num Num Num Assign NameStore BinOpSub NameLoad Num Assign NameStore SubscriptLoad NameLoad Index Num For NameStore Call NameLoad Num BinOpAdd NameLoad Num body AugAssignAdd NameStore BinOpDiv SubscriptLoad NameLoad Index NameLoad BinOpAdd NameLoad NameLoad Assign NameStore BinOpAdd BinOpAdd NameLoad NameLoad Num Return BinOpAdd BinOpSub BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpMult Num AttributeLoad NameLoad attr BinOpMult BinOpAdd NameLoad Num Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Str FunctionDef arguments args NameParam NameParam defaults Str Str body FunctionDef arguments args defaults vararg kwarg body Assign NameStore ListLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index Str NameLoad FunctionDef arguments args defaults vararg kwarg body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call SubscriptLoad NameLoad Index Num NameLoad NameLoad decorator_list Return NameLoad decorator_list Return NameLoad decorator_list
N/A N/A numpy np N/A theano N/A theano.tensor T random_orthogonal N/A N/A dim special N/A True N/A N/A N/A dim 1 N/A N/A N/A N/A N/A N/A np random uniform 0.5 N/A N/A N/A N/A np ones N/A 1 1 N/A N/A N/A N/A np ones N/A 1 1 N/A P N/A N/A N/A np random randn dim dim N/A N/A N/A N/A N/A np linalg matrix_rank P dim N/A N/A P N/A N/A N/A np random randn dim dim N/A N/A U S V N/A N/A N/A np linalg svd P N/A P N/A N/A np dot U V N/A special N/A N/A N/A N/A N/A N/A np linalg det P 0 N/A N/A N/A P N/A N/A N/A N/A 0 1 N/A P N/A N/A N/A N/A 1 0 N/A P N/A log_gamma_lanczos N/A N/A z N/A N/A N/A flip_z N/A 1 z N/A flip_z N/A N/A T switch N/A flip_z 0 1 flip_z N/A small N/A N/A N/A N/A np log N/A np pi N/A N/A T log N/A N/A T sin N/A N/A np pi z N/A log_gamma_lanczos_sub flip_z N/A big N/A log_gamma_lanczos_sub z N/A N/A N/A T switch N/A z 0.5 small big N/A log_gamma_lanczos_sub N/A N/A z N/A N/A N/A g 7 N/A p N/A N/A np array N/A 1.0 676.520368122 -1259.13921672 771.323428778 -176.615029162 12.5073432787 -0.138571095266 9.98436957802e-06 1.50563273515e-07 N/A z N/A z 1 N/A x N/A p N/A 0 N/A i N/A range 1 N/A g 2 N/A N/A x N/A N/A p N/A i N/A z i N/A t N/A N/A z g 0.5 N/A N/A N/A N/A N/A N/A np log N/A N/A np sqrt N/A 2 N/A np pi N/A N/A z 0.5 N/A N/A T log t t N/A N/A T log x N/A N/A 
def log_gamma_lanczos_sub(z): #vectorised version
    # Coefficients used by the GNU Scientific Library
    g = 7
    p = np.array([0.99999999999980993, 676.5203681218851, -1259.1392167224028,
                  771.32342877765313, -176.61502916214059, 12.507343278686905,
                  -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7])  
    z = z - 1
    
    zs = T.shape_padleft(z, 1) + T.shape_padright(T.arange(1, g+2), z.ndim)
    x = T.sum(T.shape_padright(p[1:], z.ndim) / zs, axis=0) + p[0]
	t = z + g + 0.5
    return np.log(np.sqrt(2*np.pi)) + (z + 0.5) * T.log(t) - t + T.log(x)
 lazytheanofunc N/A N/A on_unused_input mode N/A warn FAST_RUN N/A theanofunction N/A N/A N/A args kwargs N/A N/A f N/A None N/A N/A N/A N/A kwargs has_key on_unused_input N/A N/A N/A kwargs N/A on_unused_input on_unused_input N/A N/A N/A N/A kwargs has_key mode N/A N/A N/A kwargs N/A mode mode func N/A N/A N/A args2 kwargs2 N/A N/A N/A N/A f N/A 0 None N/A N/A N/A f N/A 0 N/A N/A theano function args kwargs N/A N/A N/A f N/A 0 args2 kwargs2 N/A N/A func N/A N/A theanofunction N/A