Skip to content

Commit

Permalink
Renamed package "italia" to "ital"
Browse files Browse the repository at this point in the history
  • Loading branch information
Callidior committed Aug 29, 2018
1 parent f368508 commit 8ca2164
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 28 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions italia/adapt_al.py → ital/adapt_al.py
Expand Up @@ -55,11 +55,11 @@ def __init__(self, data = None, queries = [], length_scale = 0.1, var = 1.0, noi
- queries: list of query data points to initially fit the GP to. If empty, the GP will not be fitted.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- subsample: if set to a positive integer, the set of candidates will be restricted to a random subsample
of unlabeled instance of the given size.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions italia/ital.py → ital/ital.py
Expand Up @@ -24,11 +24,11 @@ def __init__(self, data = None, queries = [], length_scale = 0.1, var = 1.0, noi
- queries: list of query data points to initially fit the GP to. If empty, the GP will not be fitted.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- label_prob: the assumed probability that the user annotates a sample.
Expand Down
9 changes: 5 additions & 4 deletions italia/ital_regression.py → ital/ital_regression.py
Expand Up @@ -25,11 +25,11 @@ def __init__(self, data = None, train_init = [], y_init = [], length_scale = 0.1
- y_init: initial training values for the samples in train_init.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- label_prob: the assumed probability that the user annotates a sample.
Expand Down Expand Up @@ -96,7 +96,8 @@ def fetch_unlabelled(self, k, show_progress = False):
class MutualInformation(object):
""" Helper class for ITAL_KL computing mutual information between the value distribution and the feedback distribution of a set of samples.
\mathrm{MI}(R,F\ |\ A) = \int_{-\infty}^{\infty} { p(F=f\ |\ A) \cdot \mathrm{KL}\Bigl(p(R=r\ |\ F=f,A) \Bigm\| p(R=r\ |\ A)\Bigr) }
.. math::
\mathrm{MI}(R,F\ |\ A) = \int_{-\infty}^{\infty} { p(F=f\ |\ A) \cdot \mathrm{KL}\Bigl(p(R=r\ |\ F=f,A) \Bigm\| p(R=r\ |\ A)\Bigr) }
"""

def __init__(self, learner, eps = 1e-6):
Expand Down
6 changes: 3 additions & 3 deletions italia/mcmi.py → ital/mcmi.py
Expand Up @@ -27,11 +27,11 @@ def __init__(self, data = None, queries = [], length_scale = 0.1, var = 1.0, noi
- queries: list of query data points to initially fit the GP to. If empty, the GP will not be fitted.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- subsample: if set to a positive integer, the set of candidates will be restricted to a random subsample
of unlabeled instance of the given size.
Expand Down
8 changes: 4 additions & 4 deletions italia/regression_base.py → ital/regression_base.py
Expand Up @@ -20,11 +20,11 @@ def __init__(self, data = None, train_init = [], y_init = [], length_scale = 0.1
- y_init: initial training values for the samples in train_init.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
"""

self.length_scale = length_scale
Expand Down Expand Up @@ -144,7 +144,7 @@ def updated_prediction(self, feedback, test_ind, cov_mode = 'full'):

ind, val, _ = self.labeled_feedback(feedback)
if len(ind) == 0:
return self.predict_stored(test_ind, cov_mode = cov_mode)
return self.gp.predict_stored(test_ind, cov_mode = cov_mode)
else:
ind.sort()
return self.gp.updated_prediction(ind, val, test_ind, cov_mode = cov_mode)
Expand Down
8 changes: 4 additions & 4 deletions italia/retrieval_base.py → ital/retrieval_base.py
Expand Up @@ -18,11 +18,11 @@ def __init__(self, data = None, queries = [], length_scale = 0.1, var = 1.0, noi
- queries: list of query data points to initially fit the GP to. If empty, the GP will not be fitted.
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- length_scale: the `sigma` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- var: the `var` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of italia.gp.GaussianProcess).
- noise: the `sigma_noise` hyper-parameter of the kernel (see documentation of ital.gp.GaussianProcess).
"""

self.length_scale = length_scale
Expand Down Expand Up @@ -152,7 +152,7 @@ def updated_prediction(self, feedback, test_ind, cov_mode = 'full'):

rel, irr, _ = self.partition_feedback(feedback)
if len(rel) + len(irr) == 0:
return self.predict_stored(test_ind, cov_mode=cov_mode)
return self.gp.predict_stored(test_ind, cov_mode=cov_mode)
else:
rel.sort()
irr.sort()
Expand Down
2 changes: 1 addition & 1 deletion optimize_parameters.py
Expand Up @@ -9,7 +9,7 @@

import utils
from datasets import RegressionDataset, MultitaskRetrievalDataset
from italia.gp import GaussianProcess
from ital.gp import GaussianProcess



Expand Down
2 changes: 1 addition & 1 deletion run_experiment.py
Expand Up @@ -9,7 +9,7 @@

import utils, viz_utils
from datasets import MultitaskRetrievalDataset
from italia.regression_base import ActiveRegressionBase
from ital.regression_base import ActiveRegressionBase



Expand Down
6 changes: 3 additions & 3 deletions utils.py
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from italia import *
from ital import *
from datasets import load_dataset, RetrievalDataset, MultitaskRetrievalDataset, RegressionDataset


Expand Down Expand Up @@ -92,8 +92,8 @@ def load_config(config_file, section, overrides = {}):
a (parser, dataset, learner) tuple whose individual components are:
- parser: a configparser.ConfigParser instance,
- dataset: a dataset.Dataset instance,
- learner: either an italia.retrieval_base.ActiveRetrievalBase instance, an
italia.regression_base.ActiveRegressionBase instance.
- learner: either an ital.retrieval_base.ActiveRetrievalBase instance, an
ital.regression_base.ActiveRegressionBase instance.
The learner is usually initialized with the data from the dataset,
except in the case of a MultitaskDataset, where an uninitialized
learner will be returned.
Expand Down
4 changes: 2 additions & 2 deletions viz_utils.py
Expand Up @@ -124,7 +124,7 @@ def plot_learning_step(dataset, queries, relevance, learner, ret, fb):
- relevance: the ground-truth relevance labels of all samples in dataset.X_train.
- learner: an italia.retrieval_base.ActiveRetrievalBase instance.
- learner: an ital.retrieval_base.ActiveRetrievalBase instance.
- ret: the indices of the samples selected for the current active learning batch.
Expand Down Expand Up @@ -193,7 +193,7 @@ def plot_regression_step(dataset, init, learner, ret, fb):
- init: list of indices of the initial training samples in dataset.X_train.
- learner: an italia.regression_base.ActiveRegressionBase instance.
- learner: an ital.regression_base.ActiveRegressionBase instance.
- ret: the indices of the samples selected for the current active learning batch.
Expand Down

0 comments on commit 8ca2164

Please sign in to comment.