Example #1
0
def run_test():
    signal_size, dict_size = 200, 240
    deltas = numpy.arange(0.1, 1, 0.1)
    rhos = numpy.arange(0.1, 1, 0.1)

    print "Running synthesis phase transition..."
    pt = SynthesisPhaseTransition(
        signal_size,
        dict_size,
        deltas,
        rhos,
        3,
        numpy.inf,
        [
            #OrthogonalMatchingPursuit(0, algorithm="sparsify_QR"),
            #IterativeHardThresholding(1e-10, sparsity="real", maxiter=1000)
            #ApproximateMessagePassing(1e-6, 1000),
        ])
    pt.run(solve=True, check=False, processes=None)
    pt.plot(solve=True, check=False)

    pt.plot(solve=True, check=False, thresh=1e-6)

    #pt.savedata()

    print "Example finished."
def run_synthesis():
    signal_size, dict_size = 50, 70
    deltas = numpy.arange(0.1, 0.9, 0.1)
    rhos = numpy.arange(0.1, 0.9, 0.1)

    print "Running synthesis phase transition..."
    pt = SynthesisPhaseTransition(signal_size, dict_size, deltas, rhos, 3,
                                  [OrthogonalMatchingPursuit(1e-6, algorithm="sparsify_QR"),
                                   L1Min(1e-6),
                                   SmoothedL0(1e-6),
                                   TwoStageThresholding(1e-6)])
    pt.run()
    pt.plot()

    print "Example finished."
def run_synthesis():
    signal_size, dict_size = 50, 100
    deltas = numpy.arange(0.1, 1, 0.03)
    rhos = numpy.arange(0.1, 1, 0.03)
    #signal_size, dict_size = 512,512
    #deltas = [0.5]
    #rhos = numpy.arange(0.1, 0.51, 0.01)


    print "Running synthesis phase transition..."
    pt = SynthesisPhaseTransition(signal_size, dict_size, deltas, rhos, 30,
                                  [OrthogonalMatchingPursuit(1e-6, algorithm="sparsify_QR"),
                                   L1Min(1e-6),
                                   SmoothedL0(1e-6),
                                   TwoStageThresholding(1e-6),
                                   ApproximateMessagePassing(1e-6, 1000),
                                   IterativeHardThresholding(1e-10, sparsity="real", maxiter=1000) ])
    pt.run()
    pt.plot()

    print "Example finished."
def run_test():
    signal_size, dict_size = 200, 240
    deltas = numpy.arange(0.1, 1, 0.1)
    rhos = numpy.arange(0.1, 1, 0.1)

    print "Running synthesis phase transition..."
    pt = SynthesisPhaseTransition(signal_size, dict_size, deltas, rhos, 3, numpy.inf,
                                  [
                                  #OrthogonalMatchingPursuit(0, algorithm="sparsify_QR"),
                                  #IterativeHardThresholding(1e-10, sparsity="real", maxiter=1000)
                                  #ApproximateMessagePassing(1e-6, 1000),
                                  ])
    pt.run(solve=True, check=False, processes=None)
    pt.plot(solve=True, check=False)

    pt.plot(solve=True, check=False, thresh=1e-6)

    #pt.savedata()

    print "Example finished."
Example #5
0
def run_synthesis():
    signal_size, dict_size = 50, 100
    deltas = numpy.arange(0.1, 1, 0.03)
    rhos = numpy.arange(0.1, 1, 0.03)
    #signal_size, dict_size = 512,512
    #deltas = [0.5]
    #rhos = numpy.arange(0.1, 0.51, 0.01)

    print "Running synthesis phase transition..."
    pt = SynthesisPhaseTransition(signal_size, dict_size, deltas, rhos, 30, [
        OrthogonalMatchingPursuit(1e-6, algorithm="sparsify_QR"),
        L1Min(1e-6),
        SmoothedL0(1e-6),
        TwoStageThresholding(1e-6),
        ApproximateMessagePassing(1e-6, 1000),
        IterativeHardThresholding(1e-10, sparsity="real", maxiter=1000)
    ])
    pt.run()
    pt.plot()

    print "Example finished."