def plot_SpikeSlab(parameterized, fignum=None, ax=None, colors=None, side_by_side=True):
if ax is None:<EOL><INDENT>if side_by_side:<EOL><INDENT>fig = pb.figure(num=fignum, figsize=(<NUM_LIT:16>, min(<NUM_LIT:12>, (<NUM_LIT:2> * parameterized.mean.shape[<NUM_LIT:1>]))))<EOL><DEDENT>else:<EOL><INDENT>fig = pb.figure(num=fignum, figsize=(<NUM_LIT:8>, min(<NUM_LIT:12>, (<NUM_LIT:2> * parameterized.mean.shape[<NUM_LIT:1>]))))<EOL><DEDENT><DEDENT>if colors is None:<EOL><INDENT>from ..Tango import mediumList<EOL>from itertools import cycle<EOL>colors = cycle(mediumList)<EOL>pb.clf()<EOL><DEDENT>else:<EOL><INDENT>colors = iter(colors)<EOL><DEDENT>plots = []<EOL>means, variances, gamma = parameterized.mean, parameterized.variance, parameterized.binary_prob<EOL>x = np.arange(means.shape[<NUM_LIT:0>])<EOL>for i in range(means.shape[<NUM_LIT:1>]):<EOL><INDENT>if side_by_side:<EOL><INDENT>sub1 = (means.shape[<NUM_LIT:1>],<NUM_LIT:2>,<NUM_LIT:2>*i+<NUM_LIT:1>)<EOL>sub2 = (means.shape[<NUM_LIT:1>],<NUM_LIT:2>,<NUM_LIT:2>*i+<NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>sub1 = (means.shape[<NUM_LIT:1>]*<NUM_LIT:2>,<NUM_LIT:1>,<NUM_LIT:2>*i+<NUM_LIT:1>)<EOL>sub2 = (means.shape[<NUM_LIT:1>]*<NUM_LIT:2>,<NUM_LIT:1>,<NUM_LIT:2>*i+<NUM_LIT:2>)<EOL><DEDENT>a = fig.add_subplot(*sub1)<EOL>a.plot(means, c='<STR_LIT:k>', alpha=<NUM_LIT>)<EOL>plots.extend(a.plot(x, means.T[i], c=next(colors), label=r"<STR_LIT>".format(i)))<EOL>a.fill_between(x,<EOL>means.T[i] - <NUM_LIT:2> * np.sqrt(variances.T[i]),<EOL>means.T[i] + <NUM_LIT:2> * np.sqrt(variances.T[i]),<EOL>facecolor=plots[-<NUM_LIT:1>].get_color(),<EOL>alpha=<NUM_LIT>)<EOL>a.legend(borderaxespad=<NUM_LIT:0.>)<EOL>a.set_xlim(x.min(), x.max())<EOL>if i < means.shape[<NUM_LIT:1>] - <NUM_LIT:1>:<EOL><INDENT>a.set_xticklabels('<STR_LIT>')<EOL><DEDENT>a = fig.add_subplot(*sub2)<EOL>a.bar(x,gamma[:,i],bottom=<NUM_LIT:0.>,linewidth=<NUM_LIT:1.>,width=<NUM_LIT:1.0>,align='<STR_LIT>')<EOL>a.set_xlim(x.min(), x.max())<EOL>a.set_ylim([<NUM_LIT:0.>,<NUM_LIT:1.>])<EOL><DEDENT>pb.draw()<EOL>fig.tight_layout(h_pad=<NUM_LIT>) <EOL>return fig<EOL>
Plot latent space X in 1D:

    - if fig is given, create input_dim subplots in fig and plot in these
    - if ax is given plot input_dim 1D latent space plots of X into each `axis`
    - if neither fig nor ax is given create a figure with fignum and plot in there

colors:
    colors of different latent space dimensions input_dim