def __init__(self, input_dim=<NUM_LIT:1>, output_dim=<NUM_LIT:1>, hidden_dims=[<NUM_LIT:3>], prior=None, activation='<STR_LIT>', name='<STR_LIT>'):
super(MLPext, self).__init__(input_dim=input_dim, output_dim=output_dim, name=name)<EOL>assert activation in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT:relu>'], NotImplementedError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>self.hidden_dims = hidden_dims<EOL>self.W_list = list()<EOL>self.b_list = list()<EOL>for i in np.arange(len(hidden_dims) + <NUM_LIT:1>):<EOL><INDENT>in_dim = input_dim if i == <NUM_LIT:0> else hidden_dims[i - <NUM_LIT:1>]<EOL>out_dim = output_dim if i == len(hidden_dims) else hidden_dims[i]<EOL>self.W_list.append(Param('<STR_LIT>'%i, np.random.randn(in_dim, out_dim)))<EOL>self.b_list.append(Param('<STR_LIT>'%i, np.random.randn(out_dim)))<EOL><DEDENT>if prior is not None:<EOL><INDENT>for W, b in zip(self.W_list, self.b_list):<EOL><INDENT>W.set_prior(Gaussian(<NUM_LIT:0>, prior))<EOL>b.set_prior(Gaussian(<NUM_LIT:0>, prior))<EOL><DEDENT><DEDENT>self.link_parameters(*self.W_list)<EOL>self.link_parameters(*self.b_list)<EOL>if activation == '<STR_LIT>':<EOL><INDENT>self.act = np.tanh<EOL>self.grad_act = lambda x: <NUM_LIT:1.> / np.square(np.cosh(x))<EOL><DEDENT>elif activation == '<STR_LIT>':<EOL><INDENT>from scipy.special import expit<EOL>from scipy.stats import logistic<EOL>self.act = expit<EOL>self.grad_act = logistic._pdf<EOL><DEDENT>elif activation == '<STR_LIT:relu>':<EOL><INDENT>self.act = lambda x: x * (x > <NUM_LIT:0>)<EOL>self.grad_act = lambda x: <NUM_LIT:1.> * (x > <NUM_LIT:0>)<EOL><DEDENT>
:param input_dim: number of input dimensions
:param output_dim: number of output dimensions
:param hidden_dims: list of hidden sizes of hidden layers
:param prior: variance of Gaussian prior on all variables. If None, no prior is used (default: None)
:param activation: choose activation function. Allowed values are 'tanh' and 'sigmoid'
:param name: