use of org.apache.logging.log4j.core.config.LoggerConfig in project pyramid by cheng-li.
the class ElasticNetLogisticTrainerTest method main.
public static void main(String[] args) throws Exception {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.OFF);
ctx.updateLoggers();
test3();
}
use of org.apache.logging.log4j.core.config.LoggerConfig in project pyramid by cheng-li.
the class BMTrainerTest method main.
public static void main(String[] args) {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers();
test5();
}
use of org.apache.logging.log4j.core.config.LoggerConfig in project pyramid by cheng-li.
the class AugmentedLRLossTest method main.
public static void main(String[] args) throws Exception {
LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();
LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers();
MultiLabelClfDataSet dataSet = TRECFormat.loadMultiLabelClfDataSet(new File(DATASETS, "scene/train"), DataSetType.ML_CLF_DENSE, true);
MultiLabelClfDataSet testSet = TRECFormat.loadMultiLabelClfDataSet(new File(DATASETS, "scene/test"), DataSetType.ML_CLF_DENSE, true);
AugmentedLR augmentedLR = new AugmentedLR(dataSet.getNumFeatures(), 1);
double[][] gammas = new double[dataSet.getNumDataPoints()][1];
for (int i = 0; i < dataSet.getNumDataPoints(); i++) {
gammas[i][0] = 1;
}
AugmentedLRLoss loss = new AugmentedLRLoss(dataSet, 0, gammas, augmentedLR, 1, 1);
LBFGS lbfgs = new LBFGS(loss);
for (int i = 0; i < 100; i++) {
lbfgs.iterate();
System.out.println(loss.getValue());
}
}
Aggregations