Documentation ¶
Index ¶
- Constants
- func CleanupPAIModel(ir *ir.TrainStmt, session *pb.Session) error
- func Evaluate(ir *ir.EvaluateStmt, session *pb.Session, ...) (code, paiCmd, requirements string, e error)
- func InitializeKMeansAttributes(trainStmt *ir.TrainStmt) error
- func OSSModelURL(modelFullPath string) string
- func Predict(ir *ir.PredictStmt, session *pb.Session, ...) (code, paiCmd, requirements string, e error)
- func TFLoadAndEvaluate(ir *ir.EvaluateStmt, session *pb.Session, modelPath string) (string, error)
- func TFLoadAndExplain(ir *ir.ExplainStmt, session *pb.Session, modelPath string, expn *ExplainRender) (string, error)
- func TFLoadAndPredict(ir *ir.PredictStmt, session *pb.Session, modelPath string) (string, error)
- func TFTrainWithLoadAndSave(ir *ir.TrainStmt, session *pb.Session, modelPathToSave, modelPathToLoad string, ...) (string, error)
- func Train(ir *ir.TrainStmt, session *pb.Session, ...) (code, paiCmd, requirements string, e error)
- type ClusterConfig
- type ExplainRender
- type PSConfig
- type WorkerConfig
Constants ¶
const BucketName = "sqlflow-models"
BucketName is the OSS bucket to save trained models
Variables ¶
This section is empty.
Functions ¶
func CleanupPAIModel ¶
CleanupPAIModel can drop saved PAI model
func Evaluate ¶
func Evaluate(ir *ir.EvaluateStmt, session *pb.Session, tarball, paramsFile, modelName, ossModelPath, cwd string, modelType int) (code, paiCmd, requirements string, e error)
Evaluate generates a Python program for evaluate a TensorFlow model.
func InitializeKMeansAttributes ¶
InitializeKMeansAttributes initializes the attributes of KMeans and does type checking for them
func OSSModelURL ¶
OSSModelURL returns model path on OSS like: oss://bucket/project/userid/modelname/
func Predict ¶
func Predict(ir *ir.PredictStmt, session *pb.Session, tarball, paramsFile, modelName, ossModelPath, cwd string, modelType int) (code, paiCmd, requirements string, e error)
Predict generates a Python program for train a TensorFlow model.
func TFLoadAndEvaluate ¶
TFLoadAndEvaluate generates PAI-TF evaluate program.
func TFLoadAndExplain ¶
func TFLoadAndExplain(ir *ir.ExplainStmt, session *pb.Session, modelPath string, expn *ExplainRender) (string, error)
TFLoadAndExplain generates PAI-TF explain program.
func TFLoadAndPredict ¶
TFLoadAndPredict generates PAI-TF prediction program.
func TFTrainWithLoadAndSave ¶
func TFTrainWithLoadAndSave(ir *ir.TrainStmt, session *pb.Session, modelPathToSave, modelPathToLoad string, cc *ClusterConfig) (string, error)
TFTrainWithLoadAndSave generates PAI-TF train program. Load pre-trained model if modelPathToLoad != "". Save the trained model to modelPathToSave.
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { PS PSConfig `json:"ps"` Worker WorkerConfig `json:"worker"` Evaluator *WorkerConfig `json:"evaluator,omitempty"` }
ClusterConfig implicates PAI distributed task meta
func GetClusterConfig ¶
func GetClusterConfig(attrs map[string]interface{}) (*ClusterConfig, error)
GetClusterConfig returns ClusterConfig object comes from WITH clause
type ExplainRender ¶
type ExplainRender struct { Code string PaiCmd string Requirements string // contains filtered or unexported fields }
ExplainRender used for PAI
func Explain ¶
func Explain(ir *ir.ExplainStmt, session *pb.Session, tarball, paramsFile, modelName, ossModelPath, cwd string, modelType int) (*ExplainRender, error)
Explain generates a Python program for train a TensorFlow model.
func (*ExplainRender) Draw ¶
func (expn *ExplainRender) Draw() (string, error)
Draw returns the explain result(png) as HTML
type WorkerConfig ¶
WorkerConfig implicates Worker Config