def plotOil(X, lbls): Xstor = ndlwrap.toarray(X) pyplot.figure() ind = numpy.nonzero(lbls[:, 0] == 1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'ro') ind = numpy.nonzero(lbls[:, 1] == 1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'bx') ind = numpy.nonzero(lbls[:, 2] == 1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'gs')
def plotOil(X, lbls): Xstor = ndlwrap.toarray(X) pyplot.figure() ind = numpy.nonzero(lbls[:, 0]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'ro') ind = numpy.nonzero(lbls[:, 1]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'bx') ind = numpy.nonzero(lbls[:, 2]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'gs')
kern2 = nl.biasKern(X) kern3 = nl.whiteKern(X) kern3.setVariance(1e-3) kern.addKern(kern1) kern.addKern(kern2) kern.addKern(kern3) noise = nl.gaussianNoise(Y) # Create a GP model. model = nl.gp(q, d, X, Y, kern, noise, nl.gp.DTCVAR, 100, 3) model.setBetaVals(math.exp(2)) #pdb.set_trace() model.setDefaultOptimiser(nl.gp.CG) model.setOptimiseX(True) # Optimise the GP. model.optimise(100) Xstor = ndlwrap.toarray(X) pyplot.figure() ind = numpy.nonzero(lbls[:, 0]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'ro') ind = numpy.nonzero(lbls[:, 1]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'bx') ind = numpy.nonzero(lbls[:, 2]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'gs')
kern3 = ndlml.whiteKern(X) kern.addKern(kern1) kern.addKern(kern2) kern.addKern(kern3) noise = ndlml.gaussianNoise(Y) # Create an GP model. model = ndlml.gp(2, 12, X, Y, kern, noise, ndlml.gp.FTC, 100, 3) model.setOptimiseX(True) model.setDefaultOptimiser(ndlml.gp.GD) model.setLearnRate(0.00005) model.setMomentum(0.9) # Optimise the GP. model.optimise(10000) Xstor = ndlwrap.toarray(X) pyplot.figure() ind = numpy.nonzero(lbls[:, 0]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'ro') ind = numpy.nonzero(lbls[:, 1]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'bx') ind = numpy.nonzero(lbls[:, 2]==1) pyplot.plot(Xstor[ind, 0], Xstor[ind, 1], 'gs')