매우 간단한 질문이 있지만이 문제를 해결하는 방법을 찾지 못했습니다. 아래에 함수 정의가 있습니다.
function model = oasis(data, class_labels, parms)
% model = oasis(data, class_labels, parms)
%
% Code version 1.3 May 2011 Fixed random seed setting
% Code version 1.2 May 2011 added call to oasis_m.m
% Code version 1.1 May 2011 handle gaps in class_labels
%
% Input:
% -- data - Nxd sparse matrix (each instance being a ROW)
% -- class_labels - label of each data point (Nx1 integer vector)
% -- parms (do sym, do_psd, aggress etc.)
%
% Output:
% -- model.W - dxd matrix
% -- model.loss_steps - a binary vector: was there an update at
% each iterations
% -- modeo.parms, the actual parameters used in the run (inc. defaults)
%
% Parameters:
% -- aggress: The cutoff point on the size of the correction
% (default 0.1)
% -- rseed: The random seed for data point selection
% (default 1)
% -- do_sym: Whether to symmetrize the matrix every k steps
% (default 0)
% -- do_psd: Whether to PSD the matrix every k steps, including
% symmetrizing them (defalut 0)
% -- do_save: Whether to save the intermediate matrices. Note that
% saving is before symmetrizing and/or PSD in case they exist
% (default 0)
% -- save_path: In case do_save==1 a filename is needed, the
% format is save_path/part_k.mat
% -- num_steps - Number of total steps the algorithm will
% run (default 1M steps)
% -- save_every: Number of steps between each save point
% (default num_steps/10)
% -- sym_every: An integer multiple of "save_every",
% indicates the frequency of symmetrizing in case do_sym=1. The
% end step will also be symmetrized. (default 1)
% -- psd_every: An integer multiple of "save_every",
% indicates the frequency of projecting on PSD cone in case
% do_psd=1. The end step will also be PSD. (default 1)
% -- use_matlab: Use oasis_m.m instead of oasis_c.c
% This is provided in the case of compilation problems.
%
이 기능을 사용하고 싶지만 매개 변수를 설정하거나 기본값을 사용하는 방법을 모르겠습니다. 이 경우 변수 parms는 무엇이며 다른 모든 변수를 유지하는 객체입니까? 매개 변수 이름에 값을 더한 구문과 같은 파이썬을 만들 수 있습니까? 예를 들면 :
model = oasis(data_example, labels_example, agress = 0.2)
또한 올바르게 이해했다면 출력에 model과 modeo라는 두 개의 Object가 있으므로이 함수가 반환하는 모든 내용을 수신하려면이 호출을해야합니까?
[model,modeo] = oasis(data_example, labels_example, ?(parms)?)
위의 문서에서 어느 것이 옳은지 모르겠지만 matlab의 선택적 매개 변수에는 두 가지 일반적인 방법이 있습니다.
매개 변수 값 쌍 :
model = oasis(data, class_labels, 'do_sym',1,'do_psd',0)
구조체 :
params.do_sym=1
params.do_psd=0
model = oasis(data, class_labels, params)
아마도이 두 가지 가능성 중 하나가 옳을 것입니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다