def initialize_kwds(relaxation_kwds, n_samples, n_components, intrinsic_dim):
new_relaxation_kwds = {<EOL>'<STR_LIT>': np.array([],dtype=np.float64),<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': <NUM_LIT>,<EOL>'<STR_LIT>': <NUM_LIT:0>,<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': <NUM_LIT:0>,<EOL>'<STR_LIT>': False,<EOL>'<STR_LIT>': '<STR_LIT>' if n_components > intrinsic_dim else '<STR_LIT>',<EOL>'<STR_LIT>': np.arange(n_samples),<EOL>'<STR_LIT>': current_time_str(),<EOL>'<STR_LIT>': default_basedir,<EOL>'<STR_LIT>': <NUM_LIT:10>,<EOL>'<STR_LIT>': <NUM_LIT:1>,<EOL>'<STR_LIT>': False,<EOL>}<EOL>new_relaxation_kwds.update(relaxation_kwds)<EOL>backup_dir = os.path.join(new_relaxation_kwds['<STR_LIT>'], new_relaxation_kwds['<STR_LIT>'])<EOL>new_relaxation_kwds['<STR_LIT>'] = backup_dir<EOL>create_output_dir(backup_dir)<EOL>new_relaxation_kwds = convert_to_int(new_relaxation_kwds)<EOL>if new_relaxation_kwds['<STR_LIT>'].shape[<NUM_LIT:0>] != <NUM_LIT:0>:<EOL><INDENT>weights = np.absolute(new_relaxation_kwds['<STR_LIT>']).astype(np.float64)<EOL>new_relaxation_kwds['<STR_LIT>'] = weights / np.sum(weights)<EOL><DEDENT>if new_relaxation_kwds['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>new_relaxation_kwds.setdefault('<STR_LIT>', <NUM_LIT:0.1>)<EOL><DEDENT>if n_components != intrinsic_dim and new_relaxation_kwds['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if n_components == intrinsic_dim and new_relaxation_kwds['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if new_relaxation_kwds['<STR_LIT>'] and new_relaxation_kwds['<STR_LIT>'].shape[<NUM_LIT:0>] < n_samples:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>prefix = '<STR_LIT>' if new_relaxation_kwds['<STR_LIT>'] else '<STR_LIT>'<EOL>new_relaxation_kwds['<STR_LIT>'] = '<STR_LIT>'.format(prefix,new_relaxation_kwds['<STR_LIT>'])<EOL>step_method = new_relaxation_kwds['<STR_LIT>']<EOL>if new_relaxation_kwds['<STR_LIT>'] == True:<EOL><INDENT>new_relaxation_kwds.setdefault('<STR_LIT>', False)<EOL>init_eta_max = <NUM_LIT:2>**<NUM_LIT:11> if new_relaxation_kwds['<STR_LIT>'] else <NUM_LIT:2>**<NUM_LIT:4><EOL>new_relaxation_kwds.setdefault('<STR_LIT>',init_eta_max)<EOL><DEDENT>else:<EOL><INDENT>new_relaxation_kwds.setdefault('<STR_LIT>', <NUM_LIT:1.0>)<EOL><DEDENT>if step_method == '<STR_LIT>':<EOL><INDENT>new_relaxation_kwds.setdefault('<STR_LIT:m>', <NUM_LIT>)<EOL><DEDENT>return new_relaxation_kwds<EOL>
Initialize relaxation keywords.

Parameters
----------
relaxation_kwds : dict
    weights : numpy array, the weights
    step_method : string { 'fixed', 'momentum' }
        which optimizers to use
    linesearch : bool
        whether to do linesearch in search for eta in optimization
    verbose : bool
        whether to print reports to I/O when doing relaxation
    niter : int
        number of iterations to run.
    niter_trace : int
        number of iterations to be traced.
    presave : bool
        whether to store precomputed keywords to files or not.
    sqrd : bool
        whether to use squared norm in loss function. Default : True
    alpha : float
        shrinkage rate for previous gradient. Default : 0
    projected : bool
        whether or not to optimize via projected gradient descent on differences S
    lossf : string { 'epsilon', 'rloss' }
        which loss function to optimize.
        Default : 'rloss' if n == d, otherwise 'epsilon'
    subset : numpy array
        Subset to do relaxation on.
    sub_dir : string
        sub_dir used to store the outputs.
    backup_base_dir : string
        base directory used to store outputs
        Final path will be backup_base_dir/sub_dir
    saveiter : int
        save backup on every saveiter iterations
    printiter : int
        print report on every printiter iterations
    save_init : bool
        whether to save Y0 and L before running relaxation.