seisnn.core.Instance

class seisnn.core.Instance(input_data=None)[source]

Bases: object

Main class for data transfer.

__init__(input_data=None)[source]

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

Methods

__init__([input_data])

Initialize self.

from_example(example)

Initialized from example protocol.

from_feature(feature)

Initialized from feature dict.

from_stream(stream)

Initialized from stream.

get_tfrecord_dir(sub_dir)

param sub_dir

Sub TFRecord directory: ‘train’, ‘test’, ‘eval’

get_tfrecord_name()

plot(**kwargs)

Plot dataset.

to_example()

Returns example protocol.

to_feature()

Returns Feature object.

to_tfrecord(file_path)

Write TFRecord to file path.

Attributes

label

metadata

predict

trace

from_example(example)[source]

Initialized from example protocol.

Parameters

example – Example protocol.

from_feature(feature)[source]

Initialized from feature dict.

Parameters

feature (Feature) – Feature dict.

from_stream(stream)[source]

Initialized from stream.

Parameters

stream

Returns

get_tfrecord_dir(sub_dir)[source]
Parameters

sub_dir – Sub TFRecord directory: ‘train’, ‘test’, ‘eval’

Returns

TFRecord directory

plot(**kwargs)[source]

Plot dataset.

Parameters

kwargs – Keywords pass into plot.

to_example()[source]

Returns example protocol.

Returns

Example protocol.

to_feature()[source]

Returns Feature object.

Return type

Feature

Returns

Feature object.

to_tfrecord(file_path)[source]

Write TFRecord to file path.

Parameters

file_path (str) – Output path.