forked from decile-team/submodlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetFunction.cpp
More file actions
35 lines (33 loc) · 2.14 KB
/
Copy pathSetFunction.cpp
File metadata and controls
35 lines (33 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<iostream>
#include<set>
#include<vector>
#include<utility>
#include<string>
#include"SetFunction.h"
#include"optimizers/NaiveGreedyOptimizer.h"
#include"optimizers/LazyGreedyOptimizer.h"
#include"optimizers/StochasticGreedyOptimizer.h"
#include"optimizers/LazierThanLazyGreedyOptimizer.h"
double SetFunction::evaluate(std::unordered_set<ll> const &X){}
double SetFunction::evaluateWithMemoization(std::unordered_set<ll> const &X){}
double SetFunction::marginalGain(std::unordered_set<ll> const &X, ll item){}
double SetFunction::marginalGainWithMemoization(std::unordered_set<ll> const &X, ll item, bool enableChecks){}
void SetFunction::updateMemoization(std::unordered_set<ll> const &X, ll item){}
std::unordered_set<ll> SetFunction::getEffectiveGroundSet(){}
std::vector<std::pair<ll, double>> SetFunction::maximize(std::string optimizer, float budget, bool stopIfZeroGain, bool stopIfNegativeGain, float epsilon, bool verbose, bool showProgress, const std::vector<float>& costs, bool costSensitiveGreedy){
if(optimizer == "NaiveGreedy") {
return NaiveGreedyOptimizer().maximize(*this, budget, stopIfZeroGain, stopIfNegativeGain, verbose, showProgress, costs, costSensitiveGreedy);
} else if(optimizer == "LazyGreedy") {
return LazyGreedyOptimizer().maximize(*this, budget, stopIfZeroGain, stopIfNegativeGain, verbose, showProgress, costs, costSensitiveGreedy);
} else if(optimizer == "StochasticGreedy") {
return StochasticGreedyOptimizer().maximize(*this, budget, stopIfZeroGain, stopIfNegativeGain, epsilon, verbose, showProgress, costs, costSensitiveGreedy);
} else if(optimizer == "LazierThanLazyGreedy") {
return LazierThanLazyGreedyOptimizer().maximize(*this, budget, stopIfZeroGain, stopIfNegativeGain, epsilon, verbose, showProgress, costs, costSensitiveGreedy);
} else {
std::cout << "Invalid Optimizer" << std::endl;
}
}
void SetFunction::cluster_init(ll n_, std::vector<std::vector<float>> const &k_dense_, std::unordered_set<ll> const &ground_, bool partial, float lambda){}
void SetFunction::setMemoization(std::unordered_set<ll> const &X){}
void SetFunction::clearMemoization(){}
SetFunction * SetFunction::clone() {return NULL;}