RAMjET

ramjet.models.cura

Module Contents

Classes

OldCura A general convolutional model for light curve data.
CuraWider A general convolutional model for light curve data.
CuraNarrower A general convolutional model for light curve data.
CuraWithDropout A general convolutional model for light curve data.
Cura A general convolutional model for light curve data.
Cursa Model groups layers into an object with training and inference features.
CuraFinalAveragePoolNarrower A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNorm A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormNoDo A general convolutional model for light curve data.
CuraFinalAveragePoolWithL2 A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerer A general convolutional model for light curve data.
CuraFinalAveragePoolSuperNarrowNoDo A general convolutional model for light curve data.
CuraFinalAveragePoolSuperNarrowDo0d25 A general convolutional model for light curve data.
CuraFinalAveragePoolMainLineDo0d25 A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerLessDeep A general convolutional model for light curve data.
CuraFinalAveragePoolNonBottleNeck A general convolutional model for light curve data.
CuraFinalAveragePoolNonBottleNeckShallow A general convolutional model for light curve data.
CuraFinalAveragePoolNonBottleNeckShallowVeryNarrow A general convolutional model for light curve data.
CuraFinalAveragePoolNonBottleNeckShallowVeryNarrowInitialBn A general convolutional model for light curve data.
CuraFinalAveragePoolSuperNarrowNoDoMainPathRepeat A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormNoDoMainPathRepeat A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormMainPathRepeatRareMainPathDropout Model groups layers into an object with training and inference features.
CuraFinalAveragePoolSuperNarrowDo0d25InitialBatchNorm A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNorm A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNormNoDo A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNormAfterActivations A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormWithL2 A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormWithL21en3 A general convolutional model for light curve data.
CuraFinalAveragePoolNarrowerInitialBatchNormWithL21en4 A general convolutional model for light curve data.
class OldCura(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraWider(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraNarrower(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraWithDropout(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class Cura(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class Cursa(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

Model groups layers into an object with training and inference features.

Parameters:
  • inputs – The input(s) of the model: a keras.Input object or list of keras.Input objects.
  • outputs – The output(s) of the model. See Functional API example below.
  • name – String, the name of the model.

There are two ways to instantiate a Model:

1 - With the “Functional API”, where you start from Input, you chain layer calls to specify the model’s forward pass, and finally you create your model from inputs and outputs:

```python import tensorflow as tf

inputs = tf.keras.Input(shape=(3,)) x = tf.keras.layers.Dense(4, activation=tf.nn.relu)(inputs) outputs = tf.keras.layers.Dense(5, activation=tf.nn.softmax)(x) model = tf.keras.Model(inputs=inputs, outputs=outputs) ```

Note: Only dicts, lists, and tuples of input tensors are supported. Nested inputs are not supported (e.g. lists of list or dicts of dict).

2 - By subclassing the Model class: in that case, you should define your layers in __init__ and you should implement the model’s forward pass in call.

```python import tensorflow as tf

class MyModel(tf.keras.Model):

def __init__(self):
super(MyModel, self).__init__() self.dense1 = tf.keras.layers.Dense(4, activation=tf.nn.relu) self.dense2 = tf.keras.layers.Dense(5, activation=tf.nn.softmax)
def call(self, inputs):
x = self.dense1(inputs) return self.dense2(x)

model = MyModel() ```

If you subclass Model, you can optionally have a training argument (boolean) in call, which you can use to specify a different behavior in training and inference:

```python import tensorflow as tf

class MyModel(tf.keras.Model):

def __init__(self):
super(MyModel, self).__init__() self.dense1 = tf.keras.layers.Dense(4, activation=tf.nn.relu) self.dense2 = tf.keras.layers.Dense(5, activation=tf.nn.softmax) self.dropout = tf.keras.layers.Dropout(0.5)
def call(self, inputs, training=False):

x = self.dense1(inputs) if training:

x = self.dropout(x, training=training)

return self.dense2(x)

model = MyModel() ```

Once the model is created, you can config the model with losses and metrics with model.compile(), train the model with model.fit(), or use the model to do prediction with model.predict().

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrower(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNorm(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormNoDo(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolWithL2(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerer(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolSuperNarrowNoDo(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolSuperNarrowDo0d25(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolMainLineDo0d25(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerLessDeep(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNonBottleNeck(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNonBottleNeckShallow(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNonBottleNeckShallowVeryNarrow(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNonBottleNeckShallowVeryNarrowInitialBn(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolSuperNarrowNoDoMainPathRepeat(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormNoDoMainPathRepeat(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormMainPathRepeatRareMainPathDropout(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

Model groups layers into an object with training and inference features.

Parameters:
  • inputs – The input(s) of the model: a keras.Input object or list of keras.Input objects.
  • outputs – The output(s) of the model. See Functional API example below.
  • name – String, the name of the model.

There are two ways to instantiate a Model:

1 - With the “Functional API”, where you start from Input, you chain layer calls to specify the model’s forward pass, and finally you create your model from inputs and outputs:

```python import tensorflow as tf

inputs = tf.keras.Input(shape=(3,)) x = tf.keras.layers.Dense(4, activation=tf.nn.relu)(inputs) outputs = tf.keras.layers.Dense(5, activation=tf.nn.softmax)(x) model = tf.keras.Model(inputs=inputs, outputs=outputs) ```

Note: Only dicts, lists, and tuples of input tensors are supported. Nested inputs are not supported (e.g. lists of list or dicts of dict).

2 - By subclassing the Model class: in that case, you should define your layers in __init__ and you should implement the model’s forward pass in call.

```python import tensorflow as tf

class MyModel(tf.keras.Model):

def __init__(self):
super(MyModel, self).__init__() self.dense1 = tf.keras.layers.Dense(4, activation=tf.nn.relu) self.dense2 = tf.keras.layers.Dense(5, activation=tf.nn.softmax)
def call(self, inputs):
x = self.dense1(inputs) return self.dense2(x)

model = MyModel() ```

If you subclass Model, you can optionally have a training argument (boolean) in call, which you can use to specify a different behavior in training and inference:

```python import tensorflow as tf

class MyModel(tf.keras.Model):

def __init__(self):
super(MyModel, self).__init__() self.dense1 = tf.keras.layers.Dense(4, activation=tf.nn.relu) self.dense2 = tf.keras.layers.Dense(5, activation=tf.nn.softmax) self.dropout = tf.keras.layers.Dropout(0.5)
def call(self, inputs, training=False):

x = self.dense1(inputs) if training:

x = self.dropout(x, training=training)

return self.dense2(x)

model = MyModel() ```

Once the model is created, you can config the model with losses and metrics with model.compile(), train the model with model.fit(), or use the model to do prediction with model.predict().

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolSuperNarrowDo0d25InitialBatchNorm(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNorm(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNormNoDo(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormEveryWeightBatchNormAfterActivations(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormWithL2(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormWithL21en3(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.

class CuraFinalAveragePoolNarrowerInitialBatchNormWithL21en4(number_of_label_types=1, number_of_input_channels: int = 1)[source]

Bases: tensorflow.keras.Model

A general convolutional model for light curve data.

__init__(self, number_of_label_types=1, number_of_input_channels: int = 1)[source]

Initialize self. See help(type(self)) for accurate signature.

call(self, inputs, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • inputs – The input tensor.
  • training – A boolean specifying if the layer should be in training mode.
  • mask – A mask for the input tensor.
Returns:

The output tensor of the layer.