Module Assign NameStore Str Import alias identifier Import alias identifier ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpMult Num BinOpPow BinOpDiv BinOpSub NameLoad NameLoad NameLoad Num Return BinOpDiv Call AttributeLoad NameLoad attr NameLoad BinOpMult Call AttributeLoad NameLoad attr BinOpMult Num AttributeLoad NameLoad attr NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Num keyword Str Assign NameStore Num Expr Call AttributeLoad NameLoad attr Call NameLoad keyword Num keyword Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Call NameLoad Num keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Num Num Num attr Num Num Assign NameStore BinOpAdd BinOpAdd NameLoad BinOpMult Num Call AttributeLoad NameLoad attr BinOpMult BinOpMult Num AttributeLoad NameLoad attr NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Num Num AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad Num Num Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Num Num Num Assign NameStore ListLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Slice NameLoad BinOpMult NameLoad Num Assign NameStore SubscriptLoad NameLoad Slice BinOpMult NameLoad Num BinOpMult NameLoad Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpMult SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad Index Num For NameStore Call NameLoad Num NameLoad body AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad ExtSlice Slice Index NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice Num Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad ExtSlice Slice Slice Num Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad Str keyword Num Expr Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr
N/A N/A __author__ Martin Felder N/A pylab p N/A numpy np pybrain.structure.modules LinearLayer BiasUnit SigmoidLayer pybrain.structure FullConnection FeedForwardNetwork pybrain.datasets SupervisedDataSet pybrain.supervised.trainers.mixturedensity RPropMinusTrainerMix BackpropTrainerMix pybrain.structure.modules.mixturedensity MixtureDensityLayer multigaussian N/A N/A x mean stddev N/A N/A N/A Returns value of uncorrelated Gaussians at given scalar point.
    x: scalar
    mean: vector
    stddev: vector
     N/A tmp N/A -0.5 N/A N/A N/A x mean stddev 2 N/A N/A N/A N/A np exp tmp N/A N/A N/A np sqrt N/A 2.0 N/A np pi stddev N/A N/A N/A __name__ __main__ N/A N/A n N/A FeedForwardNetwork N/A N/A N/A n addInputModule N/A LinearLayer 1 name in N/A N_GAUSSIANS 3 N/A N/A N/A n addOutputModule N/A MixtureDensityLayer dim 1 name out mix N_GAUSSIANS N/A N/A N/A n addModule N/A BiasUnit name bias N/A N/A N/A n addConnection N/A FullConnection N/A n N/A bias N/A n N/A out N/A N/A N/A n addModule N/A SigmoidLayer 5 name hidden N/A N/A N/A n addConnection N/A FullConnection N/A n N/A bias N/A n N/A hidden N/A N/A N/A n addConnection N/A FullConnection N/A n N/A in N/A n N/A hidden N/A N/A N/A n addConnection N/A FullConnection N/A n N/A hidden N/A n N/A out N/A N/A N/A n sortModules N/A N/A N/A n _setParameters N/A N/A N/A np random uniform -0.1 0.1 size N/A n paramdim N/A y N/A N/A N/A N/A np arange 0.0 1.0 0.005 reshape 200 1 N/A x N/A N/A y N/A 0.3 N/A N/A np sin N/A N/A 2 N/A np pi y N/A N/A N/A N/A N/A np random uniform -0.1 0.1 N/A y size reshape N/A y size 1 N/A dataset N/A SupervisedDataSet 1 1 N/A N/A N/A dataset setField input x N/A N/A N/A dataset setField target y N/A trainer N/A RPropMinusTrainerMix n dataset dataset verbose True weightdecay 0.05 N/A N/A N/A trainer trainEpochs 200 N/A N/A N/A p subplot 2 2 3 N/A dens N/A N/A newx N/A N/A np arange 0.0 1.0 0.01 N/A newx N/A N/A newx reshape N/A newx size 1 N/A N/A N/A dataset setField input newx N/A out N/A N/A n activateOnDataset dataset N/A pars out N/A N/A stds N/A pars N/A N_GAUSSIANS N/A N_GAUSSIANS 2 N/A means N/A pars N/A N/A N_GAUSSIANS 2 N/A N_GAUSSIANS 3 N/A line N/A multigaussian newx means stds N/A density N/A N/A line N/A N/A N/A 0 N/A pars N/A 0 N/A gaussian N/A range 1 N_GAUSSIANS N/A N/A density N/A N/A line N/A N/A N/A gaussian N/A pars N/A gaussian N/A N/A N/A dens append density N/A newx N/A N/A newx flatten N/A dens N/A N/A N/A N/A np array dens transpose N/A N/A N/A p contourf newx newx dens 30 N/A N/A N/A p title cond. probab. dens. N/A N/A N/A p subplot 221 N/A out N/A N/A np array out N/A N/A N/A p plot newx N/A out N/A N/A N/A 0 3 N/A N/A N/A p title mixing coefficient N/A N/A N/A p subplot 222 N/A N/A N/A p plot newx N/A out N/A N/A N/A 6 9 N/A N/A N/A p title means of Gaussians N/A N/A N/A p subplot 224 N/A N/A N/A p scatter N/A N/A x flatten N/A N/A y flatten marker o edgecolor g facecolors none N/A N/A N/A p hold True N/A cmode N/A N/A dens argmax axis 0 N/A N/A N/A p plot newx N/A newx N/A cmode or markersize 3 N/A N/A N/A p xlim 0 1 N/A N/A N/A p ylim 0 1 N/A N/A N/A p title data and cond. mode N/A N/A N/A p show