def optimize_from_initial(s, max_mem=<NUM_LIT>, invert='<STR_LIT>', desc='<STR_LIT>', rz_order=<NUM_LIT:3>,<EOL>min_rad=None, max_rad=None):
RLOG.info('<STR_LIT>')<EOL>if desc is not None:<EOL><INDENT>desc_burn = desc + '<STR_LIT>'<EOL>desc_polish = desc + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>desc_burn, desc_polish = [None] * <NUM_LIT:2><EOL><DEDENT>opt.burn(s, mode='<STR_LIT>', n_loop=<NUM_LIT:3>, fractol=<NUM_LIT:0.1>, desc=desc_burn,<EOL>max_mem=max_mem, include_rad=False, dowarn=False)<EOL>opt.burn(s, mode='<STR_LIT>', n_loop=<NUM_LIT:3>, fractol=<NUM_LIT:0.1>, desc=desc_burn,<EOL>max_mem=max_mem, include_rad=True, dowarn=False)<EOL>RLOG.info('<STR_LIT>')<EOL>rad = s.obj_get_radii()<EOL>if min_rad is None:<EOL><INDENT>min_rad = <NUM_LIT:0.5> * np.median(rad)<EOL><DEDENT>if max_rad is None:<EOL><INDENT>max_rad = <NUM_LIT> * np.median(rad)<EOL><DEDENT>addsub.add_subtract(s, tries=<NUM_LIT:30>, min_rad=min_rad, max_rad=max_rad,<EOL>invert=invert)<EOL>if desc is not None:<EOL><INDENT>states.save(s, desc=desc + '<STR_LIT>')<EOL><DEDENT>RLOG.info('<STR_LIT>')<EOL>d = opt.burn(s, mode='<STR_LIT>', n_loop=<NUM_LIT:8>, fractol=<NUM_LIT>, desc=desc_polish,<EOL>max_mem=max_mem, rz_order=rz_order, dowarn=False)<EOL>if not d['<STR_LIT>']:<EOL><INDENT>RLOG.warn('<STR_LIT>')<EOL><DEDENT>return s<EOL>
Optimizes a state from an initial set of positions and radii, without
any known microscope parameters.

Parameters
----------
    s : :class:`peri.states.ImageState`
        The state to optimize. It is modified internally and returned.
    max_mem : Numeric, optional
        The maximum memory for the optimizer to use. Default is 1e9 (bytes)
    invert : Bool or `'guess'`, optional
        Set to True if the image is dark particles on a bright
        background, False otherwise. Used for add-subtract. The
        default is to guess from the state's current particles.
    desc : String, optional
        An additional description to infix for periodic saving along the
        way. Default is the null string ``''``.
    rz_order : int, optional
        ``rz_order`` as passed to opt.burn. Default is 3
    min_rad : Float or None, optional
        The minimum radius to identify a particles as bad, as passed to
        add-subtract. Default is None, which picks half the median radii.
        If your sample is not monodisperse you should pick a different
        value.
    max_rad : Float or None, optional
        The maximum radius to identify a particles as bad, as passed to
        add-subtract. Default is None, which picks 1.5x the median radii.
        If your sample is not monodisperse you should pick a different
        value.

Returns
-------
    s : :class:`peri.states.ImageState`
        The optimized state, which is the same as the input ``s`` but
        modified in-place.