tasks/vowels/test.py
def prepare_sample(sample, word_space_size):
    """
    Transform a sequence of letters and the correct response into an input vector.
    :param sample: list of letters forming word.
    :param word_space_size: how many total letters exist.
    :return: tuple including input vector and the length of its first dimension (i.e. how many one-hot vectors).
    """
    input_vec = np.array(sample[0]['inputs'], dtype=np.float32)
    seq_len = input_vec.shape[0]
    input_vec = np.array([onehot(int(code), word_space_size) for code in input_vec])

    return (
        np.reshape(input_vec, (1, -1, word_space_size)),
        seq_len
    )

    Transform a sequence of letters and the correct response into an input vector.
    :param sample: list of letters forming word.
    :param word_space_size: how many total letters exist.
    :return: tuple including input vector and the length of its first dimension (i.e. how many one-hot vectors).
    
Transform a sequence of letters and the correct response into an input vector.
Transform a sequence of letters and the correct response into an input vector .
def prepare_sample(sample, word_space_size):
    input_vec = np.array(sample[0]['inputs'], dtype=np.float32)
    seq_len = input_vec.shape[0]
    input_vec = np.array([onehot(int(code), word_space_size) for code in input_vec])
    return (
        np.reshape(input_vec, (1, -1, word_space_size)),
        seq_len
    )
def prepare_sample ( sample , word_space_size ) : input_vec = np . array ( sample [ 0 ] [ 'inputs' ] , dtype = np . float32 ) seq_len = input_vec . shape [ 0 ] input_vec = np . array ( [ onehot ( int ( code ) , word_space_size ) for code in input_vec ] ) return ( np . reshape ( input_vec , ( 1 , - 1 , word_space_size ) ) , seq_len )
Transform a sequence of letters and the correct response into an input vector.
Transform a sequence of letters and the correct response into an input vector .
"""
    Transform a sequence of letters and the correct response into an input vector.
    :param sample: list of letters forming word.
    :param word_space_size: how many total letters exist.
    :return: tuple including input vector and the length of its first dimension (i.e. how many one-hot vectors).
    """
tuple including input vector and the length of its first dimension .
tuple including input vector and the length of its first dimension .
sample
list of letters forming word.
list of letters forming word .
word_space_size
None