aibase

package
v0.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

README

RULEX 基础AI框架

科学计算

  • 概率模型
  • 均方差
  • 最小二乘法

基础AI算法

  • ANN
  • RNN

Documentation

Index

Constants

View Source
const (
	AIBaseService_Call_FullMethodName   = "/aibase.AIBaseService/Call"
	AIBaseService_Stream_FullMethodName = "/aibase.AIBaseService/Stream"
)

Variables

View Source
var AIBaseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aibase.AIBaseService",
	HandlerType: (*AIBaseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Call",
			Handler:    _AIBaseService_Call_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Stream",
			Handler:       _AIBaseService_Stream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "aibase.proto",
}

AIBaseService_ServiceDesc is the grpc.ServiceDesc for AIBaseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_aibase_proto protoreflect.FileDescriptor

Functions

func GetAi

func GetAi(uuid string) *typex.AI

func GetRuleX

func GetRuleX() typex.RuleX

func ListAi

func ListAi() []*typex.AI

func LoadAi

func LoadAi(Ai *typex.AI) error

func NewBodyPoseRecognition

func NewBodyPoseRecognition(re typex.RuleX) typex.XAi

func RegisterAIBaseServiceServer added in v0.6.7

func RegisterAIBaseServiceServer(s grpc.ServiceRegistrar, srv AIBaseServiceServer)

func RemoveAi

func RemoveAi(uuid string) error

func StartAi

func StartAi(uuid string) error

func StartTestServer added in v0.6.7

func StartTestServer()

func Stop

func Stop()

func StopAi

func StopAi(uuid string) error

func UpdateAi

func UpdateAi(Ai *typex.AI) error

Types

type AIBaseServiceClient added in v0.6.7

type AIBaseServiceClient interface {
	// 普通请求
	Call(ctx context.Context, in *CallRequest, opts ...grpc.CallOption) (*CallResponse, error)
	// 流式请求
	Stream(ctx context.Context, opts ...grpc.CallOption) (AIBaseService_StreamClient, error)
}

AIBaseServiceClient is the client API for AIBaseService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAIBaseServiceClient added in v0.6.7

func NewAIBaseServiceClient(cc grpc.ClientConnInterface) AIBaseServiceClient

type AIBaseServiceServer added in v0.6.7

type AIBaseServiceServer interface {
	// 普通请求
	Call(context.Context, *CallRequest) (*CallResponse, error)
	// 流式请求
	Stream(AIBaseService_StreamServer) error
	// contains filtered or unexported methods
}

AIBaseServiceServer is the server API for AIBaseService service. All implementations must embed UnimplementedAIBaseServiceServer for forward compatibility

type AIBaseService_StreamClient added in v0.6.7

type AIBaseService_StreamClient interface {
	Send(*StreamRequest) error
	Recv() (*StreamResponse, error)
	grpc.ClientStream
}

type AIBaseService_StreamServer added in v0.6.7

type AIBaseService_StreamServer interface {
	Send(*StreamResponse) error
	Recv() (*StreamRequest, error)
	grpc.ServerStream
}

type AIRuntime

type AIRuntime struct {
	RuleEngine typex.RuleX
	AiBases    map[string]*typex.AI
}

func AIBaseRuntime

func AIBaseRuntime() *AIRuntime

func InitAIRuntime

func InitAIRuntime(re typex.RuleX) *AIRuntime

type AiBaseServer added in v0.6.7

type AiBaseServer struct {
	UnimplementedAIBaseServiceServer
}

func (*AiBaseServer) Call added in v0.6.7

func (s *AiBaseServer) Call(ctx context.Context, req *CallRequest) (resp *CallResponse, err error)

func (*AiBaseServer) Stream added in v0.6.7

流式请求

type Algorithm

type Algorithm struct {
	UUID        string // UUID
	Type        string // 模型类型: ANN_APP1 RNN_APP2 CNN_APP3 ....
	Name        string // 名称
	State       int    // 0开启;1关闭
	Document    string // 文档连接
	Description string // 概述
}

* * 算法模型 *

type AlgorithmResource

type AlgorithmResource interface {
	Init(map[string]interface{}) error // 初始化环境
	// Type , Sample, ExpectOut
	Train(string, [][]float64, [][]float64) error      // 训练模型
	Load() error                                       // 加载模型
	OnCall(string, [][]float64) map[string]interface{} // 用数据去执行
	Unload() error                                     // 卸载模型
	AiDetail() Algorithm                               // 获取信息
}

* * AI 接口 *

type BodyPoseRecognition

type BodyPoseRecognition struct {
}

func (*BodyPoseRecognition) Infer

func (ba *BodyPoseRecognition) Infer(input [][]float64) [][]float64

func (*BodyPoseRecognition) Start

func (ba *BodyPoseRecognition) Start(map[string]interface{}) error

func (*BodyPoseRecognition) Stop

func (ba *BodyPoseRecognition) Stop()

type CallRequest added in v0.6.7

type CallRequest struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CallRequest) Descriptor deprecated added in v0.6.7

func (*CallRequest) Descriptor() ([]byte, []int)

Deprecated: Use CallRequest.ProtoReflect.Descriptor instead.

func (*CallRequest) GetData added in v0.6.7

func (x *CallRequest) GetData() []byte

func (*CallRequest) ProtoMessage added in v0.6.7

func (*CallRequest) ProtoMessage()

func (*CallRequest) ProtoReflect added in v0.6.7

func (x *CallRequest) ProtoReflect() protoreflect.Message

func (*CallRequest) Reset added in v0.6.7

func (x *CallRequest) Reset()

func (*CallRequest) String added in v0.6.7

func (x *CallRequest) String() string

type CallResponse added in v0.6.7

type CallResponse struct {
	Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*CallResponse) Descriptor deprecated added in v0.6.7

func (*CallResponse) Descriptor() ([]byte, []int)

Deprecated: Use CallResponse.ProtoReflect.Descriptor instead.

func (*CallResponse) GetResult added in v0.6.7

func (x *CallResponse) GetResult() []byte

func (*CallResponse) ProtoMessage added in v0.6.7

func (*CallResponse) ProtoMessage()

func (*CallResponse) ProtoReflect added in v0.6.7

func (x *CallResponse) ProtoReflect() protoreflect.Message

func (*CallResponse) Reset added in v0.6.7

func (x *CallResponse) Reset()

func (*CallResponse) String added in v0.6.7

func (x *CallResponse) String() string

type StreamRequest added in v0.6.7

type StreamRequest struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamRequest) Descriptor deprecated added in v0.6.7

func (*StreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead.

func (*StreamRequest) GetData added in v0.6.7

func (x *StreamRequest) GetData() []byte

func (*StreamRequest) ProtoMessage added in v0.6.7

func (*StreamRequest) ProtoMessage()

func (*StreamRequest) ProtoReflect added in v0.6.7

func (x *StreamRequest) ProtoReflect() protoreflect.Message

func (*StreamRequest) Reset added in v0.6.7

func (x *StreamRequest) Reset()

func (*StreamRequest) String added in v0.6.7

func (x *StreamRequest) String() string

type StreamResponse added in v0.6.7

type StreamResponse struct {
	Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamResponse) Descriptor deprecated added in v0.6.7

func (*StreamResponse) Descriptor() ([]byte, []int)

Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead.

func (*StreamResponse) GetResult added in v0.6.7

func (x *StreamResponse) GetResult() []byte

func (*StreamResponse) ProtoMessage added in v0.6.7

func (*StreamResponse) ProtoMessage()

func (*StreamResponse) ProtoReflect added in v0.6.7

func (x *StreamResponse) ProtoReflect() protoreflect.Message

func (*StreamResponse) Reset added in v0.6.7

func (x *StreamResponse) Reset()

func (*StreamResponse) String added in v0.6.7

func (x *StreamResponse) String() string

type UnimplementedAIBaseServiceServer added in v0.6.7

type UnimplementedAIBaseServiceServer struct {
}

UnimplementedAIBaseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAIBaseServiceServer) Call added in v0.6.7

func (UnimplementedAIBaseServiceServer) Stream added in v0.6.7

type UnsafeAIBaseServiceServer added in v0.6.7

type UnsafeAIBaseServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAIBaseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AIBaseServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL