LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::smiles_data_reader Class Reference

#include <data_reader_smiles.hpp>

Inheritance diagram for lbann::smiles_data_reader:
[legend]
Collaboration diagram for lbann::smiles_data_reader:
[legend]

Classes

struct  SampleData
 

Public Types

using offset_t = std::pair< long long, unsigned short >
 
using offset_map_t = std::unordered_map< size_t, offset_t >
 
- Public Types inherited from lbann::data_reader_sample_list< sample_list_ifstream< long long > >
using sample_name_type = typename sample_list_ifstream< long long > ::name_t
 
using sample_file_id_type = typename sample_list_ifstream< long long > ::sample_file_id_t
 
using sample_type = std::pair< sample_file_id_type, sample_name_type >
 
using file_handle_type = typename sample_list_ifstream< long long > ::file_handle_t
 
- Public Types inherited from lbann::generic_data_reader
using unused_index_map_t = std::map< execution_mode, std::vector< int > >
 

Public Member Functions

 smiles_data_reader (const bool shuffle)
 
 smiles_data_reader (const smiles_data_reader &)
 
smiles_data_readeroperator= (const smiles_data_reader &)
 
 ~smiles_data_reader () override
 
smiles_data_readercopy () const override
 
std::string get_type () const override
 
void load () override
 
int get_linearized_data_size () const override
 Get the linearized size (i.e. number of elements) in a sample. More...
 
int get_linearized_label_size () const override
 Get the linearized size (i.e. number of elements) in a label. More...
 
int get_linearized_response_size () const override
 Get the linearized size (i.e. number of elements) in a response. More...
 
const std::vector< El::Int > get_data_dims () const override
 Get the dimensions of the data. More...
 
int get_num_labels () const override
 Return the number of labels (classes) in this dataset. More...
 
void set_sequence_length (int n)
 
int get_sequence_length ()
 
void use_unused_index_set (execution_mode m) override
 
void get_sample_origin (const size_t index_in, std::string &filename_out, size_t &offset_out, unsigned short &length_out) const
 
std::set< int > get_my_indices () const
 
bool encode_smiles (const char *smiles, unsigned short size, std::vector< unsigned short > &data)
 
bool encode_smiles (const std::string &smiles, std::vector< unsigned short > &data)
 
void decode_smiles (const std::vector< unsigned short > &data, std::string &out)
 
void load_vocab (std::string filename)
 
void load_vocab (std::stringstream &s)
 
void set_linearized_data_size (size_t s)
 
std::string get_raw_sample (std::istream *istrm, size_t index, size_t buf_offset=0)
 
void set_offset (size_t index, long long offset, unsigned short length)
 
void load_list_of_samples (const std::string sample_list_file)
 
void set_metadata_filename (std::string fn)
 Sets the name of the metadata file. More...
 
const std::string & get_metadata_filename ()
 Returns the name of the metadata file. More...
 
- Public Member Functions inherited from lbann::data_reader_sample_list< sample_list_ifstream< long long > >
 data_reader_sample_list (bool shuffle=true)
 
 data_reader_sample_list (const data_reader_sample_list &)
 
data_reader_sample_listoperator= (const data_reader_sample_list &)
 
 ~data_reader_sample_list () override
 
data_reader_sample_listcopy () const override
 
void copy_members (const data_reader_sample_list &rhs)
 
std::string get_type () const override
 
std::pair< file_handle_type, sample_name_typeopen_file (size_t index)
 Open the file and get the sample name for the given index. More...
 
void close_file (size_t index_in)
 
void shuffle_indices (rng_gen &gen) override
 
void load () override
 
sample_list_ifstream< long long > & get_sample_list ()
 
sample_type get_sample (size_t index)
 
- Public Member Functions inherited from lbann::generic_data_reader
 generic_data_reader (bool shuffle=true)
 
 generic_data_reader (const generic_data_reader &)=default
 
generic_data_readeroperator= (const generic_data_reader &)=default
 
virtual ~generic_data_reader ()
 
template<class Archive >
void serialize (Archive &ar)
 
void set_comm (lbann_comm *comm)
 set the comm object More...
 
lbann_commget_comm () const
 returns a (possibly nullptr) to comm More...
 
virtual bool has_conduit_output ()
 
void set_file_dir (std::string s)
 
void set_local_file_dir (std::string s)
 
void set_max_files_to_load (size_t n)
 
std::string get_file_dir () const
 
std::string get_local_file_dir () const
 
void set_data_sample_list (std::string s)
 
std::string get_data_sample_list () const
 
void keep_sample_order (bool same_order=false)
 
void set_data_filename (std::string s)
 
std::string get_data_filename () const
 
void set_label_filename (std::string s)
 
std::string get_label_filename () const
 
void set_shuffle (bool b)
 
bool is_shuffled () const
 
void set_shuffled_indices (const std::vector< int > &indices)
 
const std::vector< int > & get_shuffled_indices () const
 
void set_first_n (int n)
 
void set_absolute_sample_count (size_t s)
 
void set_use_fraction (double s)
 
virtual void set_execution_mode_split_fraction (execution_mode m, double s)
 
virtual void set_role (std::string role)
 
std::string get_role () const
 
virtual void setup (int num_io_threads, observer_ptr< thread_pool > io_thread_pool)
 
int fetch (std::map< data_field_type, CPUMat *> &input_buffers, El::Matrix< El::Int > &indices_fetched, size_t mb_size)
 Fetch a mini-batch worth of data, including samples, labels, responses (as appropriate) More...
 
int fetch (std::vector< conduit::Node > &samples, El::Matrix< El::Int > &indices_fetched, size_t mb_size)
 
virtual bool has_data_field (data_field_type data_field) const
 Check to see if the data reader supports this specific data field. More...
 
virtual bool has_labels () const
 
virtual bool has_responses () const
 
void set_has_data_field (data_field_type const data_field, const bool b)
 Whether or not a data reader has a data field. More...
 
virtual void set_has_labels (const bool b)
 Whether or not a data reader has labels. More...
 
virtual void set_has_responses (const bool b)
 Whether or not a data reader has a response field. More...
 
void start_data_store_mini_batch_exchange ()
 
void finish_data_store_mini_batch_exchange ()
 
virtual bool update (bool is_active_reader)
 
virtual int get_num_responses () const
 Return the number of responses in this dataset. More...
 
virtual int get_linearized_size (data_field_type const &data_field) const
 get the linearized size of what is identified by desc. More...
 
virtual std::vector< El::Int > get_slice_points (const slice_points_mode var_category, bool &is_supported)
 
virtual bool position_valid () const
 True if the data reader's current position is valid. More...
 
virtual bool position_is_overrun () const
 
bool at_new_epoch () const
 True if the data reader is at the start of an epoch. More...
 
void set_mini_batch_size (const int s)
 Set the mini batch size. More...
 
int get_mini_batch_size () const
 Get the mini batch size. More...
 
int get_loaded_mini_batch_size () const
 Get the loaded mini-batch size. More...
 
int get_current_mini_batch_size () const
 Get the current mini-batch size. More...
 
int get_mini_batch_max () const
 Return the full mini_batch_size. More...
 
void set_stride_to_next_mini_batch (const int s)
 Set the mini batch stride. More...
 
int get_stride_to_next_mini_batch () const
 Return the mini batch stride. More...
 
void set_sample_stride (const int s)
 Set the sample stride. More...
 
int get_sample_stride () const
 Return the sample stride. More...
 
void set_iteration_stride (const int s)
 Set the iteration stride. More...
 
int get_iteration_stride () const
 Return the iteration stride. More...
 
virtual void set_base_offset (const int s)
 Return the base offset. More...
 
int get_base_offset () const
 Return the base offset. More...
 
void set_last_mini_batch_size (const int s)
 Set the last mini batch size. More...
 
int get_last_mini_batch_size () const
 Return the last mini batch size. More...
 
void set_stride_to_last_mini_batch (const int s)
 Set the last mini batch stride. More...
 
int get_stride_to_last_mini_batch () const
 Return the last mini batch stride. More...
 
void set_num_parallel_readers (const int s)
 Set the number of parallel readers per model. More...
 
int get_num_parallel_readers () const
 Return the number of parallel readers per model. More...
 
virtual void set_reset_mini_batch_index (const int s)
 Set the starting mini-batch index for the epoch. More...
 
int get_reset_mini_batch_index () const
 Return the starting mini-batch index for the epoch. More...
 
int get_loaded_mini_batch_index () const
 Return the current mini-batch index for the epoch. More...
 
int get_current_mini_batch_index () const
 Return the current mini-batch index for the epoch. More...
 
void set_initial_position ()
 Set the current position based on the base and model offsets. More...
 
int get_position () const
 Get the current position in the data reader. More...
 
int get_next_position () const
 Get the next position in the data reader. More...
 
int * get_indices ()
 Get a pointer to the start of the shuffled indices. More...
 
virtual int get_num_data () const
 Get the number of samples in this dataset. More...
 
int get_num_unused_data (execution_mode m) const
 Get the number of unused samples in this dataset. More...
 
int * get_unused_data (execution_mode m)
 Get a pointer to the start of the unused sample indices. More...
 
const std::vector< int > & get_unused_indices (execution_mode m)
 
void set_num_iterations_per_epoch (int num_iterations_per_epoch)
 Set the number of iterations in each epoch. More...
 
int get_num_iterations_per_epoch () const
 Get the number of iterations in each epoch. More...
 
int get_current_step_in_epoch () const
 
void resize_shuffled_indices ()
 
void select_subset_of_data ()
 
virtual bool has_list_per_model () const
 Does the data reader have a unique sample list per model. More...
 
virtual bool has_list_per_trainer () const
 Does the data reader have a unique sample list per trainer. More...
 
bool save_to_checkpoint_shared (persist &p, execution_mode mode)
 Given directory to store checkpoint files, write state to file and add to number of bytes written. More...
 
bool load_from_checkpoint_shared (persist &p, execution_mode mode)
 Given directory to store checkpoint files, read state from file and add to number of bytes read. More...
 
bool save_to_checkpoint_distributed (persist &p, execution_mode mode)
 
bool load_from_checkpoint_distributed (persist &p, execution_mode mode)
 Given directory to store checkpoint files, read state from file and add to number of bytes read. More...
 
const data_store_conduitget_data_store () const
 returns a const ref to the data store More...
 
data_store_conduitget_data_store ()
 returns a non-const ref to the data store More...
 
data_store_conduitget_data_store_ptr () const
 
void setup_data_store (int mini_batch_size)
 
void instantiate_data_store ()
 
virtual void preload_data_store ()
 
void set_gan_labelling (bool has_gan_labelling)
 
void set_gan_label_value (int gan_label_value)
 
void set_data_store (data_store_conduit *g)
 support of data store functionality More...
 
virtual bool data_store_active () const
 
virtual bool priming_data_store () const
 
virtual void post_update ()
 
void set_transform_pipeline (transform::transform_pipeline &&tp)
 
void print_get_methods (const std::string filename)
 Print the return values from various get_X methods to file. More...
 
size_t get_num_indices_to_use () const
 
void set_use_data_store (bool s)
 

Private Member Functions

void copy_members (const smiles_data_reader &rhs)
 Contains common code for operator= and copy ctor. More...
 
void do_preload_data_store () override
 
bool fetch_datum (CPUMat &X, int data_id, int mb_idx) override
 
bool fetch_label (CPUMat &Y, int data_id, int mb_idx) override
 
bool fetch_response (CPUMat &Y, int data_id, int mb_idx) override
 
void print_statistics () const
 
void load_offsets_and_lengths ()
 
void read_offset_data (std::vector< SampleData > &data)
 
void construct_conduit_node (conduit::Node &node, std::istream *istream, size_t sample_id, size_t buf_offset=0)
 
void load_sample (std::istream *istrm, size_t index, std::vector< unsigned short > &output, size_t buf_offset=0)
 
void build_some_maps ()
 
void read_metadata_file (std::vector< size_t > &samples_per_file, std::vector< std::string > &data_filenames, std::vector< std::string > &offsets_filenames)
 
bool is_delimiter (const char c)
 

Private Attributes

int m_sequence_length = 0
 
const size_t OffsetBinarySize = sizeof(long long)
 
const size_t LengthBinarySize = sizeof(unsigned short)
 
const std::streamsize OffsetAndLengthBinarySize
 
int m_linearized_data_size = 0
 
int m_linearized_label_size = 0
 
int m_linearized_response_size = 0
 
int m_num_labels = 0
 
short m_pad = 420
 
short m_unk = 421
 
short m_bos = 422
 
short m_eos = 423
 
std::string m_metadata_filename
 
std::unordered_map< char, short > m_vocab
 
std::unordered_map< short, std::string > m_vocab_inv
 
std::mutex m_mutex
 
size_t m_missing_char_in_vocab_count = 0
 
std::unordered_set< char > m_missing_chars
 
offset_map_t m_sample_offsets
 
std::unordered_map< size_t, size_t > m_index_to_local_id
 
std::unordered_map< std::string, std::map< size_t, size_t > > m_local_to_index
 
std::unordered_map< std::string, std::set< size_t > > m_filename_to_local_id_set
 
std::unordered_map< size_t, std::string > m_index_to_filename
 

Additional Inherited Members

- Public Attributes inherited from lbann::generic_data_reader
int m_mini_batch_size
 
int m_current_pos
 
int m_stride_to_next_mini_batch
 
int m_base_offset
 
int m_sample_stride
 
int m_iteration_stride
 Stride used by parallel data readers within the model. More...
 
std::vector< int > m_shuffled_indices
 
unused_index_map_t m_unused_indices
 Record of the indicies that are not being used for training. More...
 
int m_last_mini_batch_size
 
int m_stride_to_last_mini_batch
 
int m_reset_mini_batch_index
 The index at which this data reader starts its epoch. More...
 
int m_loaded_mini_batch_idx
 The index of the current mini-batch that has been loaded. More...
 
int m_current_mini_batch_idx
 
int m_num_iterations_per_epoch
 
int m_num_parallel_readers
 How many iterations all readers will execute. More...
 
size_t m_max_files_to_load
 How many parallel readers are being used. More...
 
std::string m_file_dir
 
std::string m_local_file_dir
 
std::string m_data_sample_list
 
std::string m_data_fn
 
std::string m_label_fn
 
bool m_shuffle
 
size_t m_absolute_sample_count
 
std::map< execution_mode, double > m_execution_mode_split_fraction
 
double m_use_fraction
 
int m_first_n
 
std::string m_role
 
- Protected Member Functions inherited from lbann::data_reader_sample_list< sample_list_ifstream< long long > >
void load_list_of_samples (const std::string sample_list_file)
 
void load_list_of_samples_from_archive (const std::string &sample_list_archive)
 
- Protected Member Functions inherited from lbann::generic_data_reader
size_t get_absolute_sample_count () const
 
double get_use_fraction () const
 
double get_execution_mode_split_fraction (execution_mode m) const
 
virtual bool fetch_data_block (std::map< data_field_type, CPUMat *> &input_buffers, El::Int block_offset, El::Int block_stride, El::Int mb_size, El::Matrix< El::Int > &indices_fetched)
 
bool fetch_data_block_conduit (std::vector< conduit::Node > &samples, El::Int block_offset, El::Int block_stride, El::Int mb_size, El::Matrix< El::Int > &indices_fetched)
 
virtual bool fetch_data_field (data_field_type data_field, CPUMat &Y, int data_id, int mb_idx)
 Called by fetch_data, fetch_label, fetch_response. More...
 
virtual bool fetch_conduit_node (conduit::Node &sample, int data_id)
 
CPUMat create_datum_view (CPUMat &X, const int mb_idx)
 
virtual void preprocess_data_source (int tid)
 
virtual void postprocess_data_source (int tid)
 
virtual void shuffle_indices ()
 Shuffle indices (uses the data_seq_generator) More...
 
void error_check_counts () const
 
- Protected Attributes inherited from lbann::data_reader_sample_list< sample_list_ifstream< long long > >
sample_list_ifstream< long long > m_sample_list
 
- Protected Attributes inherited from lbann::generic_data_reader
bool m_verbose = false
 
std::unordered_set< int > m_using_random_node
 
data_store_conduitm_data_store
 
lbann_commm_comm
 
bool m_use_data_store = false
 
std::map< data_field_type, bool > m_supported_input_types
 Holds a true value for each input data type that is supported. Use an ordered map so that checkpoints are stable. More...
 
bool m_gan_labelling
 
int m_gan_label_value
 
observer_ptr< thread_poolm_io_thread_pool
 
bool m_keep_sample_order
 
transform::transform_pipeline m_transform_pipeline
 
bool m_issue_warning
 

Detailed Description

Data reader for SMILES (string) data. The string data is converted to a vector of shorts according to an arbitrary mapping.

Terminology and Notes: "local_id" (or similar name): refers to a line number in a file. "global_id" (aka, sample_id, etc) refers to an index from the m_shuffled_indices vector.

Definition at line 44 of file data_reader_smiles.hpp.

Member Typedef Documentation

◆ offset_map_t

using lbann::smiles_data_reader::offset_map_t = std::unordered_map<size_t, offset_t>

Definition at line 50 of file data_reader_smiles.hpp.

◆ offset_t

using lbann::smiles_data_reader::offset_t = std::pair<long long, unsigned short>

Definition at line 49 of file data_reader_smiles.hpp.

Constructor & Destructor Documentation

◆ smiles_data_reader() [1/2]

lbann::smiles_data_reader::smiles_data_reader ( const bool  shuffle)
Here is the caller graph for this function:

◆ smiles_data_reader() [2/2]

lbann::smiles_data_reader::smiles_data_reader ( const smiles_data_reader )

◆ ~smiles_data_reader()

lbann::smiles_data_reader::~smiles_data_reader ( )
override

Member Function Documentation

◆ build_some_maps()

void lbann::smiles_data_reader::build_some_maps ( )
private

◆ construct_conduit_node()

void lbann::smiles_data_reader::construct_conduit_node ( conduit::Node &  node,
std::istream *  istream,
size_t  sample_id,
size_t  buf_offset = 0 
)
private

◆ copy()

smiles_data_reader* lbann::smiles_data_reader::copy ( ) const
inlineoverridevirtual

Implements lbann::generic_data_reader.

Definition at line 57 of file data_reader_smiles.hpp.

Here is the call graph for this function:

◆ copy_members()

void lbann::smiles_data_reader::copy_members ( const smiles_data_reader rhs)
private

Contains common code for operator= and copy ctor.

◆ decode_smiles()

void lbann::smiles_data_reader::decode_smiles ( const std::vector< unsigned short > &  data,
std::string &  out 
)

This method made public for use during testing. Decode SMILES string from a vector of shorts

Here is the caller graph for this function:

◆ do_preload_data_store()

void lbann::smiles_data_reader::do_preload_data_store ( )
overrideprivatevirtual

Reimplemented from lbann::generic_data_reader.

◆ encode_smiles() [1/2]

bool lbann::smiles_data_reader::encode_smiles ( const char *  smiles,
unsigned short  size,
std::vector< unsigned short > &  data 
)

This method made public for use during testing. Convert SMILES string to a vector of shorts

Here is the caller graph for this function:

◆ encode_smiles() [2/2]

bool lbann::smiles_data_reader::encode_smiles ( const std::string &  smiles,
std::vector< unsigned short > &  data 
)

This method made public for use during testing. Convert SMILES string to a vector of shorts

◆ fetch_datum()

bool lbann::smiles_data_reader::fetch_datum ( CPUMat X,
int  data_id,
int  mb_idx 
)
overrideprivatevirtual

Fetch a single sample into a matrix.

Parameters
XThe matrix to load data into.
data_idThe index of the datum to fetch.
mb_idxThe index within the mini-batch.

Reimplemented from lbann::generic_data_reader.

◆ fetch_label()

bool lbann::smiles_data_reader::fetch_label ( CPUMat Y,
int  data_id,
int  mb_idx 
)
overrideprivatevirtual

Fetch a single label into a matrix.

Parameters
YThe matrix to load data into.
data_idThe index of the datum to fetch.
mb_idxThe index within the mini-batch.

Reimplemented from lbann::generic_data_reader.

◆ fetch_response()

bool lbann::smiles_data_reader::fetch_response ( CPUMat Y,
int  data_id,
int  mb_idx 
)
overrideprivatevirtual

Fetch a single response into a matrix.

Parameters
YThe matrix to load data into.
data_idThe index of the datum to fetch.
mb_idxThe index within the mini-batch.

Reimplemented from lbann::generic_data_reader.

◆ get_data_dims()

const std::vector<El::Int> lbann::smiles_data_reader::get_data_dims ( ) const
inlineoverridevirtual

Get the dimensions of the data.

Reimplemented from lbann::generic_data_reader.

Definition at line 78 of file data_reader_smiles.hpp.

Here is the call graph for this function:

◆ get_linearized_data_size()

int lbann::smiles_data_reader::get_linearized_data_size ( ) const
inlineoverridevirtual

Get the linearized size (i.e. number of elements) in a sample.

Reimplemented from lbann::generic_data_reader.

Definition at line 66 of file data_reader_smiles.hpp.

Here is the caller graph for this function:

◆ get_linearized_label_size()

int lbann::smiles_data_reader::get_linearized_label_size ( ) const
inlineoverridevirtual

Get the linearized size (i.e. number of elements) in a label.

Reimplemented from lbann::generic_data_reader.

Definition at line 70 of file data_reader_smiles.hpp.

◆ get_linearized_response_size()

int lbann::smiles_data_reader::get_linearized_response_size ( ) const
inlineoverridevirtual

Get the linearized size (i.e. number of elements) in a response.

Reimplemented from lbann::generic_data_reader.

Definition at line 74 of file data_reader_smiles.hpp.

◆ get_metadata_filename()

const std::string& lbann::smiles_data_reader::get_metadata_filename ( )
inline

Returns the name of the metadata file.

Definition at line 147 of file data_reader_smiles.hpp.

◆ get_my_indices()

std::set<int> lbann::smiles_data_reader::get_my_indices ( ) const

This method is for use during testing and development. Returns the set of indices whose samples are cached in the data_store

Here is the caller graph for this function:

◆ get_num_labels()

int lbann::smiles_data_reader::get_num_labels ( ) const
inlineoverridevirtual

Return the number of labels (classes) in this dataset.

This is called at the end of update; it permits data readers to perform actions that are specific to their data sets, for example, data_reader_jag_conduit_hdf5 has the 'primary' data reader bcast its shuffled indices to the other data readers. In general most data readers will probably not overide this method. It may also be called outside of update.

Reimplemented from lbann::generic_data_reader.

Definition at line 82 of file data_reader_smiles.hpp.

◆ get_raw_sample()

std::string lbann::smiles_data_reader::get_raw_sample ( std::istream *  istrm,
size_t  index,
size_t  buf_offset = 0 
)

This method made public for use during testing.

Here is the caller graph for this function:

◆ get_sample_origin()

void lbann::smiles_data_reader::get_sample_origin ( const size_t  index_in,
std::string &  filename_out,
size_t &  offset_out,
unsigned short &  length_out 
) const

This method is for use during testing and development

Here is the caller graph for this function:

◆ get_sequence_length()

int lbann::smiles_data_reader::get_sequence_length ( )
inline

Definition at line 89 of file data_reader_smiles.hpp.

Here is the call graph for this function:

◆ get_type()

std::string lbann::smiles_data_reader::get_type ( ) const
inlineoverridevirtual

Return this data_reader's type

Implements lbann::generic_data_reader.

Definition at line 62 of file data_reader_smiles.hpp.

Here is the call graph for this function:

◆ is_delimiter()

bool lbann::smiles_data_reader::is_delimiter ( const char  c)
inlineprivate

Definition at line 254 of file data_reader_smiles.hpp.

◆ load()

void lbann::smiles_data_reader::load ( )
overridevirtual

Load the dataset. Each data reader implementation should implement this to initialize its internal data structures, determine the number of samples and their dimensionality (if needed), and set up and shuffle samples.

Implements lbann::generic_data_reader.

Here is the caller graph for this function:

◆ load_list_of_samples()

void lbann::smiles_data_reader::load_list_of_samples ( const std::string  sample_list_file)

This method made public for use during testing.

Here is the caller graph for this function:

◆ load_offsets_and_lengths()

void lbann::smiles_data_reader::load_offsets_and_lengths ( )
private

◆ load_sample()

void lbann::smiles_data_reader::load_sample ( std::istream *  istrm,
size_t  index,
std::vector< unsigned short > &  output,
size_t  buf_offset = 0 
)
private

◆ load_vocab() [1/2]

void lbann::smiles_data_reader::load_vocab ( std::string  filename)

This method made public for use during testing.

Here is the caller graph for this function:

◆ load_vocab() [2/2]

void lbann::smiles_data_reader::load_vocab ( std::stringstream &  s)

This method made public for use during testing.

◆ operator=()

smiles_data_reader& lbann::smiles_data_reader::operator= ( const smiles_data_reader )

◆ print_statistics()

void lbann::smiles_data_reader::print_statistics ( ) const
private

◆ read_metadata_file()

void lbann::smiles_data_reader::read_metadata_file ( std::vector< size_t > &  samples_per_file,
std::vector< std::string > &  data_filenames,
std::vector< std::string > &  offsets_filenames 
)
private

◆ read_offset_data()

void lbann::smiles_data_reader::read_offset_data ( std::vector< SampleData > &  data)
private

◆ set_linearized_data_size()

void lbann::smiles_data_reader::set_linearized_data_size ( size_t  s)
inline

This method made public for use during testing.

Definition at line 126 of file data_reader_smiles.hpp.

Here is the call graph for this function:

◆ set_metadata_filename()

void lbann::smiles_data_reader::set_metadata_filename ( std::string  fn)
inline

Sets the name of the metadata file.

Definition at line 141 of file data_reader_smiles.hpp.

◆ set_offset()

void lbann::smiles_data_reader::set_offset ( size_t  index,
long long  offset,
unsigned short  length 
)

This method made public only for use during testing. Insert an entry into a map: index -> (offset, length), where 'index' is an alias for an entry in the shuffled_indices

Here is the caller graph for this function:

◆ set_sequence_length()

void lbann::smiles_data_reader::set_sequence_length ( int  n)
inline

Definition at line 84 of file data_reader_smiles.hpp.

◆ use_unused_index_set()

void lbann::smiles_data_reader::use_unused_index_set ( execution_mode  m)
overridevirtual

Replaced the shuffled index set with the unused index set, empying the unused set.

Reimplemented from lbann::generic_data_reader.

Here is the caller graph for this function:

Member Data Documentation

◆ LengthBinarySize

const size_t lbann::smiles_data_reader::LengthBinarySize = sizeof(unsigned short)
private

Definition at line 155 of file data_reader_smiles.hpp.

◆ m_bos

short lbann::smiles_data_reader::m_bos = 422
private

Definition at line 178 of file data_reader_smiles.hpp.

◆ m_eos

short lbann::smiles_data_reader::m_eos = 423
private

Definition at line 179 of file data_reader_smiles.hpp.

◆ m_filename_to_local_id_set

std::unordered_map<std::string, std::set<size_t> > lbann::smiles_data_reader::m_filename_to_local_id_set
private

maps: filename -> {local_id}

Definition at line 207 of file data_reader_smiles.hpp.

◆ m_index_to_filename

std::unordered_map<size_t, std::string> lbann::smiles_data_reader::m_index_to_filename
private

maps: index -> filename

Definition at line 210 of file data_reader_smiles.hpp.

◆ m_index_to_local_id

std::unordered_map<size_t, size_t> lbann::smiles_data_reader::m_index_to_local_id
private

Here and elsewhere, 'index' refers to an entry in the shuffled indices; 'local_id' refers, loosely, to a line number in a file. Also, 'file' or 'filename' refers to a file containing SMILES strings.

maps: index -> local_id. Note: clearly the mapping is not unique, since a local_id requires a filename for full specification

Definition at line 201 of file data_reader_smiles.hpp.

◆ m_linearized_data_size

int lbann::smiles_data_reader::m_linearized_data_size = 0
private

Definition at line 170 of file data_reader_smiles.hpp.

◆ m_linearized_label_size

int lbann::smiles_data_reader::m_linearized_label_size = 0
private

Definition at line 171 of file data_reader_smiles.hpp.

◆ m_linearized_response_size

int lbann::smiles_data_reader::m_linearized_response_size = 0
private

Definition at line 172 of file data_reader_smiles.hpp.

◆ m_local_to_index

std::unordered_map<std::string, std::map<size_t, size_t> > lbann::smiles_data_reader::m_local_to_index
private

maps: filename -> { local_id -> index }

Definition at line 204 of file data_reader_smiles.hpp.

◆ m_metadata_filename

std::string lbann::smiles_data_reader::m_metadata_filename
private

Definition at line 181 of file data_reader_smiles.hpp.

◆ m_missing_char_in_vocab_count

size_t lbann::smiles_data_reader::m_missing_char_in_vocab_count = 0
private

Definition at line 188 of file data_reader_smiles.hpp.

◆ m_missing_chars

std::unordered_set<char> lbann::smiles_data_reader::m_missing_chars
private

Definition at line 189 of file data_reader_smiles.hpp.

◆ m_mutex

std::mutex lbann::smiles_data_reader::m_mutex
private

Definition at line 186 of file data_reader_smiles.hpp.

◆ m_num_labels

int lbann::smiles_data_reader::m_num_labels = 0
private

Definition at line 173 of file data_reader_smiles.hpp.

◆ m_pad

short lbann::smiles_data_reader::m_pad = 420
private

Definition at line 176 of file data_reader_smiles.hpp.

◆ m_sample_offsets

offset_map_t lbann::smiles_data_reader::m_sample_offsets
private

Definition at line 192 of file data_reader_smiles.hpp.

◆ m_sequence_length

int lbann::smiles_data_reader::m_sequence_length = 0
private

Definition at line 152 of file data_reader_smiles.hpp.

◆ m_unk

short lbann::smiles_data_reader::m_unk = 421
private

Definition at line 177 of file data_reader_smiles.hpp.

◆ m_vocab

std::unordered_map<char, short> lbann::smiles_data_reader::m_vocab
private

Definition at line 183 of file data_reader_smiles.hpp.

◆ m_vocab_inv

std::unordered_map<short, std::string> lbann::smiles_data_reader::m_vocab_inv
private

Definition at line 184 of file data_reader_smiles.hpp.

◆ OffsetAndLengthBinarySize

const std::streamsize lbann::smiles_data_reader::OffsetAndLengthBinarySize
private
Initial value:

Definition at line 156 of file data_reader_smiles.hpp.

◆ OffsetBinarySize

const size_t lbann::smiles_data_reader::OffsetBinarySize = sizeof(long long)
private

Definition at line 154 of file data_reader_smiles.hpp.


The documentation for this class was generated from the following file: