Distributed AI
Uploading Dataset
Upload the dataset to obtain a file path as a parameter of other APIs.
POST https://www.phoenix.global/sdk/computation/deAI/uploadFile
Upload a file to server
Headers
token*
string
The access token generated in the previous step
Content-Type*
multipart/form-data
content type
Request Body
file*
file
Dataset file
{
"code":200,
"msg":"[email protected]/2023-10-24T12:07:12Zy_train.csv"
}The usage of curl and golang sdk is as follows:
curl --location 'https://www.phoenix.global/sdk/computation/deAI/uploadFile' \
--header 'token: eyJhbGciOiJIUzIxxxxxxxxxxxxx' \
--form 'file=@"your local file path"'import (
"github.com/PhoenixGlobal/Phoenix-Computation-SDK/controllers"
)
func main() {
genTokenBody := common.ReqGenToken{
Email: "[email protected]",
Passwd: "xxxxxxxxxxx",
}
genTokenResult, err := controllers.GenToken(genTokenBody)
tokenMap := make(map[string]interface{})
err = json.Unmarshal(genTokenResult, &tokenMap)
token := tokenMap["token"].(string)
fileName := "absolute file path"
result, err := controllers.UploadDeAIFile(fileName, token)
......
}Evaluating CCD Cost for CNN
POST https://www.phoenix.global/sdk/computation/deAI/queryGuarantee
Evaluate the number of ccds required for training CNN model
Headers
token*
string
The access token generated in the previous step
Request Body
model*
string
Model name, which is CNN
epoch*
integer
The epoch for training
jobName*
string
Job name
x_train*
string
The path of the training dataset, obtained by calling the upload file api
y_train
string
The path of the label dataset, obtained by calling the upload file api
train_shard*
float
A decimal number greater than 0 and less than 1, indicating the proportion used for training
scale_ratio
integer
The number of colors in the picture
category*
int
Number of categories
channel
int
Image channel
The usage of curl and golang sdk is as follows:
Evaluating CCD Cost for LSTM
POST https://www.phoenix.global/sdk/computation/deAI/queryGuarantee
Evaluate the number of ccds required for training LSTM model
Headers
token*
string
The access token generated in the previous step
Request Body
jobName*
string
Job name
model*
string
Model name, which is LSTM
epoch*
integer
The epoch for training
x_train*
string
The path of the training dataset, obtained by calling the upload file api
train_shard*
float
A decimal number greater than 0 and less than 1, indicating the proportion used for training
input_width*
integer
Please refer to the website: https://www.tensorflow.org/tutorials/structured_data/time_series#data_windowing
label_width*
integer
Please refer to the website: https://www.tensorflow.org/tutorials/structured_data/time_series#data_windowing
shift*
integer
Please refer to the website: https://www.tensorflow.org/tutorials/structured_data/time_series#data_windowing
sequence_stride*
integer
Please refer to the website: https://www.tensorflow.org/tutorials/structured_data/time_series#data_windowing
sampling_rate
integer
Please refer to the website: https://www.tensorflow.org/tutorials/structured_data/time_series#data_windowing
The usage of curl and golang sdk is as follows:
Creating a CNN Job
POST https://www.phoenix.global/sdk/computation/deAI/createJob
Creating a CNN job
Headers
token*
string
The access token generated in the previous step
Request Body
jobName*
string
Job Name
batchSize*
integer
batch size
computation*
string
Computation type, which is Distributed AI
The usage of curl and golang sdk is as follows:
Creating a LSTM Job
POST https://www.phoenix.global/sdk/computation/deAI/createJob
Creating a LSTM Job
Headers
token*
string
The access token generated in the previous step
Request Body
jobName*
string
Job name
batchSize
integer
batch size
computation
string
Computation type, which is Distributed AI
The usage of curl and golang sdk is as follows:
Evaluating CCD Cost for Inference
POST https://www.phoenix.global/sdk/computation/deAI/inferenceCost
Evaluating ccd cost for inference
Headers
token*
string
The access token generated in the previous step
Request Body
data_path*
string
The path of the dataset, obtained by calling the upload file api
jobID*
string
The job id of a distributed AI job
The usage of curl and golang sdk is as follows:
Inference
POST https://www.phoenix.global/sdk/computation/deAI/inference
Inference
Headers
token*
string
The access token generated in the previous step
Request Body
jobID*
string
The job id of a distributed AI job
The usage of curl and golang sdk is as follows:
Querying Inference Result
POST https://www.phoenix.global/sdk/computation/deAI/queryInfer
Querying a inference result by id
Headers
token*
string
The access token generated in the previous step
Request Body
id*
string
The inference id, obtained by calling the inference api
The usage of curl and golang sdk is as follows:
Querying Inference Result List
POST https://www.phoenix.global/sdk/computation/deAI/queryInferList
Querying inference result list
Headers
token*
string
The access token generated in the previous step
Request Body
pageNo*
integer
Page number
pageSize*
integer
Page size
jobID*
string
Job id
The usage of curl and golang sdk is as follows: