RAMjET

ramjet.basic_models

Code for network architectures.

Module Contents

Classes

SanityCheckNetwork A network consisting of a single fully connected layer.
SimpleCubeCnn A simple 3D CNN for TESS data cubes.
SimpleLightCurveCnn A simple 1D CNN for light curves.
SimpleFfiLightCurveCnn A simple 1D CNN for FFI light curves.
SmallFfiLightCurveCnn A simple 1D CNN for FFI light curves.
SimpleLightCurveLstm A simple LSTM model for light curves.
SimpleLightCurveCnnPerTimeStepLabel A simple 1D CNN for light curves.
Conv1DTranspose A 1D transposed convolutional layer.
ConvolutionalLstm A convolutional LSTM network.
ConvolutionalLstmMeanFinal A simple convolutional LSTM that does not reduce to a final value, but instead takes the average of the final
SimpleLightCurveCnnWithLstmLayers A simple 1D CNN for light curves.
ResnetBlock1D A 1D ResNet block.
SimpleLightCurveCnnWithSkipConnections A simple 1D CNN for light curves.
HalfDepthSimpleLightCurveCnn A simple 1D CNN for light curves.
QuarterDepthSimpleLightCurveCnn A simple 1D CNN for light curves.
DoubleDepthSimpleLightCurveCnn A simple 1D CNN for light curves.
MiniDepthSimpleLightCurveCnn A simple 1D CNN for light curves.
SimplePoolingLightCurveCnn A simple CNN using max pooling to reduce the time dimension.
SimplePoolingLightCurveCnn2 A simple CNN using max pooling to reduce the time dimension.
FfiSimplePoolingLightCurveCnn2 A simple CNN using max pooling to reduce the time dimension.
class SanityCheckNetwork[source]

Bases: tensorflow.keras.Sequential

A network consisting of a single fully connected layer.

__init__(self)[source]

Creates a Sequential model instance.

Parameters:
  • layers – Optional list of layers to add to the model.
  • name – Optional name for the model.
class SimpleCubeCnn[source]

Bases: tensorflow.keras.Sequential

A simple 3D CNN for TESS data cubes.

__init__(self)[source]

Creates a Sequential model instance.

Parameters:
  • layers – Optional list of layers to add to the model.
  • name – Optional name for the model.
class SimpleLightCurveCnn(number_of_label_types=1)[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self, number_of_label_types=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 SimpleFfiLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for FFI light curves.

__init__(self)[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 SmallFfiLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for FFI light curves.

__init__(self)[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 SimpleLightCurveLstm[source]

Bases: tensorflow.keras.Model

A simple LSTM model for light curves.

__init__(self)[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 SimpleLightCurveCnnPerTimeStepLabel[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 Conv1DTranspose(filters, kernel_size, strides=1, *args, **kwargs)[source]

Bases: tensorflow.keras.layers.Layer

A 1D transposed convolutional layer.

__init__(self, filters, kernel_size, strides=1, *args, **kwargs)[source]

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

build(self, input_shape)[source]

Builds the layer.

Parameters:input_shape – The input tensor shape.
call(self, x, training=False, mask=None)[source]

The forward pass of the layer.

Parameters:
  • x – 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.

compute_output_shape(self, input_shape)[source]

The output shape of the layer.

Parameters:input_shape
Returns:
class ConvolutionalLstm[source]

Bases: tensorflow.keras.Model

A convolutional LSTM network.

__init__(self)[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 ConvolutionalLstmMeanFinal[source]

Bases: tensorflow.keras.Model

A simple convolutional LSTM that does not reduce to a final value, but instead takes the average of the final outputs.

__init__(self)[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 SimpleLightCurveCnnWithLstmLayers[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 ResnetBlock1D(layers: int, channels: int, kernel_size: int, strides=2)[source]

Bases: tensorflow.keras.layers.Layer

A 1D ResNet block.

__init__(self, layers: int, channels: int, kernel_size: int, strides=2)[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 SimpleLightCurveCnnWithSkipConnections[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 HalfDepthSimpleLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 QuarterDepthSimpleLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 DoubleDepthSimpleLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 MiniDepthSimpleLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple 1D CNN for light curves.

__init__(self)[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 SimplePoolingLightCurveCnn[source]

Bases: tensorflow.keras.Model

A simple CNN using max pooling to reduce the time dimension.

__init__(self)[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 SimplePoolingLightCurveCnn2[source]

Bases: tensorflow.keras.Model

A simple CNN using max pooling to reduce the time dimension.

__init__(self)[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 FfiSimplePoolingLightCurveCnn2[source]

Bases: tensorflow.keras.Model

A simple CNN using max pooling to reduce the time dimension.

__init__(self)[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.