import com.mindspore.flclient.FLParameter
FLParameter is used to define parameters related to federated learning.
Function |
---|
public static synchronized FLParameter getInstance() |
public String getDomainName() |
public void setDomainName(String domainName) |
public String getCertPath() |
public void setCertPath(String certPath) |
public String getTrainDataset() |
public void setTrainDataset(String trainDataset) |
public String getVocabFile() |
public void setVocabFile(String vocabFile) |
public String getIdsFile() |
public void setIdsFile(String idsFile) |
public String getTestDataset() |
public void setTestDataset(String testDataset) |
public String getFlName() |
public void setFlName(String flName) |
public String getTrainModelPath() |
public void setTrainModelPath(String trainModelPath) |
public String getInferModelPath() |
public void setInferModelPath(String inferModelPath) |
public boolean isUseSSL() |
public void setUseSSL(boolean useSSL) |
public int getTimeOut() |
public void setTimeOut(int timeOut) |
public int getSleepTime() |
public void setSleepTime(int sleepTime) |
public boolean isUseElb() |
public void setUseElb(boolean useElb) |
public int getServerNum() |
public void setServerNum(int serverNum) |
public String getClientID() |
public static synchronized FLParameter getInstance()
Obtains a single FLParameter instance.
Return value
Single object of the FLParameter type.
public String getDomainName()
Obtains the domain name set by a user.
Return value
Domain name of the string type.
public void setDomainName(String domainName)
Used to set the url for device-cloud communication. Currently, https and http communication are supported, the corresponding formats are like: https://......, http://......, and when useElb
is set to true, the format must be: https://127.0.0.0 : 6666 or http://127.0.0.0 : 6666 , where 127.0.0.0
corresponds to the ip of the machine providing cloud-side services (corresponding to the cloud-side parameter --scheduler_ip
), and 6666
corresponds to the cloud-side parameter --fl_server_port
.
Parameter
domainName
: domain name.public String getCertPath()
Obtains the certificate path set by a user.
Return value
Certificate path of the string type.
public void setCertPath(String certPath)
Sets the certificate path.
certPath
: certificate path.public String getTrainDataset()
Obtains the training dataset path set by a user.
Return value
Training dataset path of the string type.
public void setTrainDataset(String trainDataset)
Sets the training dataset path.
trainDataset
: training dataset path.public String getVocabFile()
Obtains the path of the dictionary file for data preprocessing, which is set by a user.
Return value
Path of the dictionary file for preprocessing data, which is of the string type.
public void setVocabFile(String vocabFile)
Sets the path of the dictionary file for data preprocessing.
vocabFile
: path of the dictionary file for data preprocessing.public String getIdsFile()
Obtains the path of the mapping ID file of a dictionary set by a user.
Return value
Path of the mapping ID file of a dictionary of the string type.
public void setIdsFile(String idsFile)
Sets the path of the mapping ID file of a dictionary.
Parameter
idsFile
: path of the mapping ID file of a dictionary.public String getTestDataset()
Obtains the path of the test dataset set by a user.
Return value
Path of the test dataset of the string type.
public void setTestDataset(String testDataset)
Sets the path of the test dataset.
testDataset
: path of the test dataset.public String getFlName()
Obtains the model name set by a user.
Return value
Name of a model of the string type.
public void setFlName(String flName)
Sets the model name.
flName
: model name.public String getTrainModelPath()
Obtains the path of the training model set by a user.
Return value
Path of the training model of the string type.
public void setTrainModelPath(String trainModelPath)
Sets the path of the training model.
trainModelPath
: training model path.public String getInferModelPath()
Obtains the path of the inference model set by a user.
Return value
Path of the inference model of the string type.
public void setInferModelPath(String inferModelPath)
Sets the path of the inference model.
inferModelPath
: path of the inference model.public boolean isUseSSL()
Determines whether SSL certificate authentication is performed for device-cloud communication.
Return value
The value is of the Boolean type. The value true indicates that SSL certificate authentication is performed, and the value false indicates that SSL certificate authentication is not performed.
public void setUseSSL(boolean useSSL)
Determines whether to perform SSL certificate authentication (which applies only to the HTTPS communication scenario) for device-cloud communication.
useSSL
: determines whether to perform SSL certificate authentication for device-cloud communication.public int getTimeOut()
Obtains the timeout interval set by a user for device-side communication.
Return value
Timeout interval for communication on the device, which is an integer.
public void setTimeOut(int timeOut)
Sets the timeout interval for communication on the device.
timeOut
: timeout interval for communication on the device.public int getSleepTime()
Obtains the waiting time of repeated requests set by a user.
Return value
Waiting time of repeated requests, which is an integer.
public void setSleepTime(int sleepTime)
Sets the waiting time of repeated requests.
sleepTime
: waiting time for repeated requests.public boolean isUseElb()
Determines whether the elastic load balancing is simulated, that is, whether a client randomly sends requests to a server address within a specified range.
Return value
The value is of the Boolean type. The value true indicates that the client sends requests to a random server address within a specified range. The value false indicates that the client sends a request to a fixed server address.
public void setUseElb(boolean useElb)
Determines whether to simulate the elastic load balancing, that is, whether a client randomly sends a request to a server address within a specified range.
useElb
: determines whether to simulate the elastic load balancing. The default value is false.public int getServerNum()
Obtains the number of servers that can send requests when simulating the elastic load balancing.
Return value
Number of servers that can send requests during elastic load balancing simulation, which is an integer.
public void setServerNum(int serverNum)
Sets the number of servers that can send requests during elastic load balancing simulation.
serverNum
: number of servers that can send requests during elastic load balancing simulation. The default value is 1.public String getClientID()
Obtains the unique client ID which is automatically generated in the program before starting the federated learning task.
Return value
Unique ID of the client, which is of the string type.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。