<commit_before>from keras import backend as K
from keras.layers import Layer


class ColorExtract(Layer):
    """ TODO: Make is scalable to any amount of channels. """
    def __init__(self, channel, **kwargs):
        super().__init__(**kwargs)
        assert channel in (0, 1, 2)
        self.channel = channel

    def call(self, x, mask=None):
        return x[:, :, :, (self.channel*256):(self.channel+1)*256]

    def get_output_shape_for(self, input_shape):
        output = list(input_shape)
        return (output[0], output[1], output[2], 256)

    def get_config(self):
        return dict(list(super().get_config().items()) + list({'channel': self.channel}.items()))<commit_msg>Add todo for color extract<commit_after>from keras import backend as K
from keras.layers import Layer

# TODO REMOVE
class ColorExtract(Layer):
    """ TODO: Make is scalable to any amount of channels. """
    def __init__(self, channel, **kwargs):
        super().__init__(**kwargs)
        assert channel in (0, 1, 2)
        self.channel = channel

    def call(self, x, mask=None):
        return x[:, :, :, (self.channel*256):(self.channel+1)*256]

    def get_output_shape_for(self, input_shape):
        output = list(input_shape)
        return (output[0], output[1], output[2], 256)

    def get_config(self):
        return dict(list(super().get_config().items()) + list({'channel': self.channel}.items()))
{'fraction_non_alphanumeric': 0.14864864864864866, 'fraction_numerical': 0.02275960170697013, 'mean_word_length': 3.466666666666667, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4709739', 'n_tokens_mistral': 453, 'n_tokens_neox': 427, 'n_words': 119}