Documentation
¶
Index ¶
- Variables
- func SortOrders(orders []WeightedOrder)
- type Clock
- type Config
- type Consumer
- type DeviceManager
- type MarketOrder
- type Model
- type Normalizer
- type Optimus
- type OrderClassification
- type OrderClassifier
- type OrderPolicy
- type OrderPredictor
- type OrderScanner
- type Registry
- type TrainedModel
- type Watcher
- type WeightedOrder
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDegenerateVector = errors.New("all elements in the vector the same")
)
Functions ¶
func SortOrders ¶
func SortOrders(orders []WeightedOrder)
Types ¶
type Config ¶
type Config struct {
Blockchain *blockchain.Config `yaml:"blockchain"`
PrivateKey privateKey `yaml:"ethereum" json:"-"`
Logging logging.Config `yaml:"logging"`
Node nodeConfig `yaml:"node"`
Workers map[auth.Addr]workerConfig `yaml:"workers"`
Benchmarks benchmarks.Config `yaml:"benchmarks"`
Marketplace marketplaceConfig `yaml:"marketplace"`
Optimization optimizationConfig
}
func LoadConfig ¶
type DeviceManager ¶
type DeviceManager struct {
// contains filtered or unexported fields
}
func (*DeviceManager) Consume ¶
func (m *DeviceManager) Consume(benchmarks sonm.Benchmarks) (*sonm.AskPlanResources, error)
type MarketOrder ¶
type MarketOrder = sonm.DWHOrder
type Model ¶
type Model interface {
// Train runs the training process, returning the trained model on success.
// The "trainingSet" argument is a MxN matrix, while "expectation" must be
// a M-length vector.
Train(trainingSet [][]float64, expectation []float64) (TrainedModel, error)
}
Model represents a ML model that can be trained using provided training set with some expectation.
type Normalizer ¶
type Optimus ¶
type Optimus struct {
// contains filtered or unexported fields
}
Watch for current worker's status. Collect its devices.
Worker MUST provide its network capabilities somehow.
Fetch all bids. Optimize matrix looking for price per each benchmark unit. Map each bid to functional price. Then by comparing the price with expected price we can see what's underestimated. Sort. Filter. Pick.
type OrderClassification ¶
type OrderClassification struct {
WeightedOrders []WeightedOrder
Predictor *OrderPredictor
Sigmoid sigmoid
Clock Clock
}
OrderClassification is a struct that is returned after market orders classification. Contains weighted orders for some epoch and is able to predict some order's market price.
func (*OrderClassification) RecalculateWeightsAndSort ¶
func (m *OrderClassification) RecalculateWeightsAndSort(orders []WeightedOrder)
type OrderClassifier ¶
type OrderClassifier interface {
Classify(orders []*MarketOrder) ([]WeightedOrder, error)
ClassifyExt(orders []*MarketOrder) (*OrderClassification, error)
}
TODO: Docs.
type OrderPolicy ¶
type OrderPolicy int
const (
PolicySpotOnly OrderPolicy = iota
)
func (*OrderPolicy) UnmarshalYAML ¶
func (m *OrderPolicy) UnmarshalYAML(unmarshal func(interface{}) error) error
type OrderPredictor ¶
type OrderPredictor struct {
// contains filtered or unexported fields
}
func (*OrderPredictor) PredictPrice ¶
func (m *OrderPredictor) PredictPrice(order *MarketOrder) (float64, error)
type OrderScanner ¶
type OrderScanner interface {
All(ctx context.Context) ([]*MarketOrder, error)
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry keeps all used components in itself.
func (*Registry) NewWorkerManagement ¶
type TrainedModel ¶
type WeightedOrder ¶
type WeightedOrder struct {
// Order is an initial market order.
Order *MarketOrder
// Price is an order price in USD/s.
Price float64
// PredictedPrice is a order price in USD/s, that is calculated during
// scanning and analysing the market.
PredictedPrice float64
// Weight represents some specific order weight.
//
// It fits in [0; +Inf] range and is used to reduce an order attractiveness
// if it has been laying on the market for a long time without being sold.
Weight float64
ID string
}
Click to show internal directories.
Click to hide internal directories.