<commit_before>#!/usr/bin/python3

from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np


DATASET_PATH = 'data/fashion'

def load_dataset():
    """Loads fashion dataset

    Returns:
        Datasets object
    """
    data = input_data.read_data_sets(DATASET_PATH, one_hot=True)
    return data

def get_hparams(hparams_str):
    """Parses hparams_str to HParams object.

    Arguments:
        hparams_str: String of comma separated param=value pairs.

    Returns:
        hparams: tf.contrib.training.HParams object from hparams_str. If
            hparams_str is None, then a default HParams object is returned.
    """
    hparams = tf.contrib.training.HParams(learning_rate=0.001, conv1_depth=32, conv2_depth=128,
                                          dense_layer_units=1024, batch_size=128,
                                          keep_prob=0.5, lambd=0.01, num_epochs=1, augment_percent=0.0)
    if hparams_str:
        hparams.parse(hparams_str)
    return hparams

def shuffle_dataset(images, labels):
    num_examples = images.shape[0]
    permutation = list(np.random.permutation(num_examples))
    return (images[permutation, :], labels[permutation, :])
<commit_msg>Set default lambda value to 0<commit_after>#!/usr/bin/python3

from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
import numpy as np


DATASET_PATH = 'data/fashion'

def load_dataset():
    """Loads fashion dataset

    Returns:
        Datasets object
    """
    data = input_data.read_data_sets(DATASET_PATH, one_hot=True)
    return data

def get_hparams(hparams_str):
    """Parses hparams_str to HParams object.

    Arguments:
        hparams_str: String of comma separated param=value pairs.

    Returns:
        hparams: tf.contrib.training.HParams object from hparams_str. If
            hparams_str is None, then a default HParams object is returned.
    """
    hparams = tf.contrib.training.HParams(learning_rate=0.001, conv1_depth=32, conv2_depth=128,
                                          dense_layer_units=1024, batch_size=128,
                                          keep_prob=0.5, lambd=0.0, num_epochs=1, augment_percent=0.0)
    if hparams_str:
        hparams.parse(hparams_str)
    return hparams

def shuffle_dataset(images, labels):
    num_examples = images.shape[0]
    permutation = list(np.random.permutation(num_examples))
    return (images[permutation, :], labels[permutation, :])

{'fraction_non_alphanumeric': 0.08845999195818255, 'fraction_numerical': 0.02251708886208283, 'mean_word_length': 2.8875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7223714', 'n_tokens_mistral': 808, 'n_tokens_neox': 765, 'n_words': 175}