pca

package
v0.0.0-...-db52ea4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64frombytes

func Float64frombytes(bytes []byte) float64

func MatMult4Stream

func MatMult4Stream(cryptoParams *crypto.CryptoParams, A crypto.CipherMatrix, fs *FileStream, maxLevel int, computeSquaredSum bool, nproc int) (crypto.CipherMatrix, []float64, []float64)

func MatMult4StreamPreprocess

func MatMult4StreamPreprocess(cryptoParams *crypto.CryptoParams, fs *FileStream, maxLevel int, cacheFilePrefix string)

Types

type Config

type Config struct {
	NumMainParties int `toml:"num_main_parties"`
	HubPartyId     int `toml:"hub_party_id"`

	CkksParams string `toml:"ckks_params"`

	DivSqrtMaxLen int `toml:"div_sqrt_max_len"`

	NumRows    []int `toml:"num_rows"`
	NumColumns int   `toml:"num_columns"`

	ItersPerEval  int `toml:"iter_per_eigenval"`
	NumPCs        int `toml:"num_pcs_to_remove"`
	NumOversample int `toml:"num_oversampling"`
	NumPowerIters int `toml:"num_power_iters"`

	BindingIP string `toml:"binding_ipaddr"`
	Servers   map[string]mpc.Server

	SharedKeysPath string `toml:"shared_keys_path"`

	InputFile string `toml:"input_file"` // for pca

	OutDir   string `toml:"output_dir"`
	CacheDir string `toml:"cache_dir"`

	MpcFieldSize     int    `toml:"mpc_field_size"`
	MpcDataBits      int    `toml:"mpc_data_bits"`
	MpcFracBits      int    `toml:"mpc_frac_bits"`
	MpcNumThreads    int    `toml:"mpc_num_threads"`
	MpcBooleanShares bool   `toml:"mpc_boolean_shares"`
	LocalNumThreads  int    `toml:"local_num_threads"`
	MemoryLimit      uint64 `toml:"memory_limit"`

	Debug bool `toml:"debug"`
}

type FileStream

type FileStream struct {
	// contains filtered or unexported fields
}

func NewFileStream

func NewFileStream(filename string, numRows, numCols uint64) *FileStream

func (*FileStream) CheckEOF

func (fs *FileStream) CheckEOF() bool

func (*FileStream) NextRow

func (fs *FileStream) NextRow() []float64

func (*FileStream) NumCols

func (fs *FileStream) NumCols() uint64

func (*FileStream) NumRows

func (fs *FileStream) NumRows() uint64

func (*FileStream) Reset

func (fs *FileStream) Reset()

type ProtocolInfo

type ProtocolInfo struct {
	// contains filtered or unexported fields
}

func InitializePCAProtocol

func InitializePCAProtocol(config *Config, pid int, mpcOnly bool) (pcaProt *ProtocolInfo)

func (*ProtocolInfo) CachePath

func (g *ProtocolInfo) CachePath(filename string) string

func (*ProtocolInfo) DistributedPCA

func (prot *ProtocolInfo) DistributedPCA(X, XT *FileStream, Xcache, XTcache string) (Q crypto.CipherMatrix)

func (*ProtocolInfo) GetConfig

func (prot *ProtocolInfo) GetConfig() *Config

func (*ProtocolInfo) PCA

func (prot *ProtocolInfo) PCA()

func (*ProtocolInfo) SyncAndTerminate

func (g *ProtocolInfo) SyncAndTerminate(closeChannelFlag bool)

Jump to

Keyboard shortcuts

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