synthetic_aia_mia.predictor package — src documentation

# synthetic_aia_mia.predictor package

## Submodules

## synthetic_aia_mia.predictor.adult module

Define structures to manage and interface a fully connected neural network for adult.

class synthetic_aia_mia.predictor.adult.AdultDataset(data)

  Bases: `Dataset`

  Pytorch dataset to handle adult data.

class synthetic_aia_mia.predictor.adult.AdultNN

  Bases: `object`

  Wrapper arround pytorch neural network. Interfare for hyper parameter optimisation using raytune.

  fit(dadata)

    Train and tune hyper parameters.

    Parameters:

      data – Dataset the will be split for training and hyper parameter tuning. Dataset must contain a column called “PINCP” used as training label.

  predict(dadata)

    Use a trained TabularNN to predict label of dataset.

    Parameters:

      dadata (fetch_data.Dataset) – Dataset to evaluate.

    Returns:

      Input dataset completed with hard labels, soft labels and loss.

    Return type:

      fetch_data.Dataset

class synthetic_aia_mia.predictor.adult.TabularNN(input_size, l1, l2, output_size)

  Bases: `Module`

  Pytorch neural network for adult.

  forward(x)

    Forward pass in the neural network.

    Parameters:

      x (torch.tensor) – Data points.

    Returns:

      Neural network function applied to x.

    Return type:

      torch.tensor

## synthetic_aia_mia.predictor.utk module

Define structures to manage and interface a fully connected neural network for UTKfaces.

class synthetic_aia_mia.predictor.utk.CNN(input_size, c, l1, l2, output_size)

  Bases: `Module`

  Pytorch convulutional neural network for UTKfaces.

  forward(x)

    Forward pass in the neural network.

    Parameters:

      x (torch.tensor) – Data points.

    Returns:

      Neural network function applied to x.

    Return type:

      torch.tensor

class synthetic_aia_mia.predictor.utk.UtkDataset(data)

  Bases: `Dataset`

  Pytorch dataset to handle adult data.

class synthetic_aia_mia.predictor.utk.UtkNN

  Bases: `object`

  Wrapper arround pytorch neural network. Interfare for hyper parameter optimisation using raytune.

  fit(data)

    Train and tune hyper parameters.

    Parameters:

      data (Dictionary of numpy.ndarray) – Dataset the will be split for training and hyper parameter tuning. Dataset must contain a column called “PINCP” used as training label.

  predict(data)

    Use a trained CNN to predict label of dataset.

    Parameters:

      data (numpy.ndarray) – Dataset without label.

    Returns:

      Prediction.

    Return type:

      numpy.ndarray

## Module contents