Changeset 195

Show
Ignore:
Timestamp:
05/23/08 16:16:25 (7 months ago)
Author:
edsuom
Message:

Ditching Rao-Blackwellization for now

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/AsynCluster/tags/20080523-Rao_Blackwellization/doc/svpmc/example/sv_pmc.py

    r175 r195  
    4747        help="Number of PMC population members") 
    4848    p.add_option( 
     49        "-c", "--N_chunk", 
     50        dest="N_chunk", action="store", type="int", 
     51        help="Number of population members to evaluate per chunk") 
     52    p.add_option( 
    4953        "-f", "--file", 
    5054        dest="ncFileName", action="store", 
     
    6367        help="Run with profiling") 
    6468 
    65     p.set_defaults(N_iter=100, N_members=10000, 
     69    p.set_defaults(N_iter=100, N_members=10000, N_chunk=200, 
    6670        ncFileName="svpmc.nc", socket="/tmp/.ndm") 
    6771    return p.parse_args() 
     
    120124        specFile, opts.ncFileName, opts.N_members) 
    121125    pmcObj = pmc.PMC(projectManager, socket) 
     126    pmcObj.chunkSize = opts.N_chunk 
    122127    reactor.callWhenRunning(run, pmcObj, opts.N_iter, profile=opts.profile) 
    123128    reactor.run() 
  • projects/AsynCluster/tags/20080523-Rao_Blackwellization/svpmc/model.py

    r192 r195  
    196196     
    197197    """ 
    198     keyAttrs = {'y':None, 'wiggle':1.0, 'N1': 20, 'N2':6, 'Ne':3} 
     198    keyAttrs = {'y':None, 'wiggle':1.0, 'N1': 30, 'N2':10, 'Ne':3} 
    199199 
    200200    #--- Properties ----------------------------------------------------------- 
  • projects/AsynCluster/tags/20080523-Rao_Blackwellization/svpmc/params.py

    r194 r195  
    7676            if shape is None: 
    7777                shape = FA.shape 
    78             elif FA.shape != shape
     78            elif FA.shape[1:] != shape[1:]
    7979                raise ValueError( 
    8080                    "FlexArray dimensions must agree except for d_0") 
     
    275275    paramNames = ['dname', 'loc', 'scale', 'a', 'b'] 
    276276    N_draw = 1000 
    277     N_attempts = 3
     277    N_attempts = 20
    278278 
    279279    class Constant(object): 
     
    384384                break 
    385385        else: 
    386             # Could't come up with a jump from this point, error 
    387             raise ValueError("Couldn't come up with a valid jump") 
    388             # TODO: fall back to an independent draw from the prior 
    389             # distribution 
     386            # Could't come up with a jump from this point, fall back to an 
     387            # independent draw from the prior distribution 
     388            x = self.rvs() 
     389            px = self.pdf(x) 
     390            pV = px * s.ones_like(self.V) 
    390391        return self.Jump(x, px, pV) 
    391392 
  • projects/AsynCluster/tags/20080523-Rao_Blackwellization/svpmc/pmc.py

    r194 r195  
    140140 
    141141    """ 
    142     chunkSize = 500 
     142    chunkSize = 100 
    143143     
    144144    def __init__(self, projectManager, socket=None): 
  • projects/AsynCluster/trunk/doc/svpmc/example/sv_pmc.py

    r175 r195  
    4747        help="Number of PMC population members") 
    4848    p.add_option( 
     49        "-c", "--N_chunk", 
     50        dest="N_chunk", action="store", type="int", 
     51        help="Number of population members to evaluate per chunk") 
     52    p.add_option( 
    4953        "-f", "--file", 
    5054        dest="ncFileName", action="store", 
     
    6367        help="Run with profiling") 
    6468 
    65     p.set_defaults(N_iter=100, N_members=10000, 
     69    p.set_defaults(N_iter=100, N_members=10000, N_chunk=200, 
    6670        ncFileName="svpmc.nc", socket="/tmp/.ndm") 
    6771    return p.parse_args() 
     
    120124        specFile, opts.ncFileName, opts.N_members) 
    121125    pmcObj = pmc.PMC(projectManager, socket) 
     126    pmcObj.chunkSize = opts.N_chunk 
    122127    reactor.callWhenRunning(run, pmcObj, opts.N_iter, profile=opts.profile) 
    123128    reactor.run() 
  • projects/AsynCluster/trunk/svpmc/model.py

    r192 r195  
    196196     
    197197    """ 
    198     keyAttrs = {'y':None, 'wiggle':1.0, 'N1': 20, 'N2':6, 'Ne':3} 
     198    keyAttrs = {'y':None, 'wiggle':1.0, 'N1': 30, 'N2':10, 'Ne':3} 
    199199 
    200200    #--- Properties ----------------------------------------------------------- 
  • projects/AsynCluster/trunk/svpmc/params.py

    r194 r195  
    7676            if shape is None: 
    7777                shape = FA.shape 
    78             elif FA.shape != shape
     78            elif FA.shape[1:] != shape[1:]
    7979                raise ValueError( 
    8080                    "FlexArray dimensions must agree except for d_0") 
     
    275275    paramNames = ['dname', 'loc', 'scale', 'a', 'b'] 
    276276    N_draw = 1000 
    277     N_attempts = 3
     277    N_attempts = 20
    278278 
    279279    class Constant(object): 
     
    384384                break 
    385385        else: 
    386             # Could't come up with a jump from this point, error 
    387             raise ValueError("Couldn't come up with a valid jump") 
    388             # TODO: fall back to an independent draw from the prior 
    389             # distribution 
     386            # Could't come up with a jump from this point, fall back to an 
     387            # independent draw from the prior distribution 
     388            x = self.rvs() 
     389            px = self.pdf(x) 
     390            pV = px * s.ones_like(self.V) 
    390391        return self.Jump(x, px, pV) 
    391392 
  • projects/AsynCluster/trunk/svpmc/pmc.py

    r194 r195  
    140140 
    141141    """ 
    142     chunkSize = 500 
     142    chunkSize = 100 
    143143     
    144144    def __init__(self, projectManager, socket=None):