Documentation ¶
Index ¶
- func BroadCastModel(avg_learner *LearnerInterface, learners *[]LearnerInterface)
- func FitLearners(learners *[]LearnerInterface, x *[]map[string]float64, y *[]string)
- func LoadData(fname string) (*[]map[string]float64, *[]string)
- func LoadFromStdin() ([]map[string]float64, []string)
- func Max(x, y float64) float64
- func Min(x, y float64) float64
- func Normal_CDF(mu, sigma float64) func(x float64) float64
- func ShuffleData(x *[]map[string]float64, y *[]string)
- type Adam
- type Arow
- type CW
- type Classifier
- type Client
- type Data
- type Dict
- type Feature
- type Learner
- func (this *Learner) Fit(*[]map[string]float64, *[]int)
- func (this *Learner) GetDics() (*Dict, *Dict)
- func (this *Learner) GetNonZeroParams() *[][][]Param
- func (this *Learner) GetParam() *[][]float64
- func (this *Learner) GetParams() *[][][]float64
- func (this *Learner) Name() string
- func (this *Learner) Save(fname string)
- func (this *Learner) SaveBinary(fname string)
- func (this *Learner) SetDics(ftdict, labeldict *Dict)
- func (this *Learner) SetParam(w *[][]float64)
- func (this *Learner) SetParams(params *[][][]float64)
- type LearnerInterface
- type LearnerServer
- type Margin
- type Margins
- type Model
- type PA
- type Param
- type Perceptron
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BroadCastModel ¶
func BroadCastModel(avg_learner *LearnerInterface, learners *[]LearnerInterface)
func FitLearners ¶
func FitLearners(learners *[]LearnerInterface, x *[]map[string]float64, y *[]string)
func LoadFromStdin ¶
func Normal_CDF ¶
Cumulative Distribution Function for the Normal distribution
func ShuffleData ¶
Types ¶
type Adam ¶
ADAM: A METHOD FOR STOCHASTIC OPTIMIZATION http://arxiv.org/pdf/1412.6980.pdf
type Arow ¶
- http://webee.technion.ac.il/people/koby/publications/arow_nips09.pdf - http://web.eecs.umich.edu/~kulesza/pubs/arow_mlj13.pdf
func (*Arow) GetNonZeroParams ¶
type CW ¶
- http://www.cs.jhu.edu/~mdredze/publications/icml_variance.pdf - http://www.aclweb.org/anthology/D09-1052 - http://www.jmlr.org/papers/volume13/crammer12a/crammer12a.pdf
type Classifier ¶
func LoadClassifier ¶
func LoadClassifier(fname string) Classifier
func LoadClassifierBinary ¶
func LoadClassifierBinary(fname string) Classifier
func NewClassifier ¶
func NewClassifier() Classifier
func (*Classifier) PredictTopN ¶
type Client ¶
type Client struct { }
func (*Client) SendData ¶
func (this *Client) SendData(host, port string, data *Data) *LearnerInterface
func (*Client) SendModel ¶
func (this *Client) SendModel(host, port string, learner *LearnerInterface)
type Data ¶
type LearnerInterface ¶
type LearnerInterface interface { Name() string Fit(*[]map[string]float64, *[]string) Save(string) SaveBinary(string) GetParam() *[][]float64 GetParams() *[][][]float64 GetNonZeroParams() *[][][]Param GetDics() (*Dict, *Dict) SetParam(*[][]float64) SetParams(*[][][]float64) SetDics(*Dict, *Dict) // contains filtered or unexported methods }
func AverageModels ¶
func AverageModels(learners []LearnerInterface) *LearnerInterface
Repeat following processes:
- For every two learners, calculate average model,
- generate a slice of averaged models.
Finally, return an average model over all learners.
type LearnerServer ¶
type LearnerServer struct { Learner LearnerInterface Host string Port string }
func NewLearnerServer ¶
func NewLearnerServer(host, port string) LearnerServer
func (*LearnerServer) Start ¶
func (this *LearnerServer) Start()
type Model ¶
type Model struct { Algorightm string `json:"a" msgpack:"a"` Id2Feature []string `json:"id2f" msgpack:"id2f"` Feature2Id map[string]int `json:"f2id" msgpack:"f2id"` Params [][][]float64 `json:"params msgpack:"params"` Id2Label []string `json:"id2y" msgpack:"id2y"` Label2Id map[string]int `json:"y2id" msgpack:"y2id"` }
type PA ¶
type PA struct { *Learner C float64 /* degree of aggressiveness */ Tau func(float64, float64, float64) float64 }
http://www.jmlr.org/papers/volume7/crammer06a/crammer06a.pdf
type Perceptron ¶
type Perceptron struct {
*Learner
}
func NewPerceptron ¶
func NewPerceptron() *Perceptron
func (*Perceptron) Name ¶
func (this *Perceptron) Name() string
Click to show internal directories.
Click to hide internal directories.