<commit_before>#include <iostream>
#include <neu/layer/max_pooling.hpp>
#include <neu/image.hpp>
#include <neu/kernel.hpp>

int main() {
	std::cout << "hello world" << std::endl;
	auto& queue = boost::compute::system::default_queue();
	auto context = boost::compute::system::default_context();

	auto batch_size = 1u;
	neu::gpu_vector input;
	for(auto b = 0u; b < batch_size; ++b) {
		auto input_image =
			neu::load_rgb_image_as_3ch_image_vector("../../../data/lena512.bmp");
		auto cpu_input = std::get<0>(input_image);
		input.insert(input.end(), cpu_input.begin(), cpu_input.end());
	}

	neu::layer::geometric_layer_property glp{512, 7, 3, 3, 2, 3};
	auto pool = neu::layer::max_pooling(glp, batch_size, context);

	neu::gpu_vector output(neu::layer::whole_output_size(pool));
	neu::layer::forward(pool, input, output, queue);
	neu::save_3ch_image_vector_as_rgb_image(neu::to_cpu_vector(output, queue),
		neu::layer::output_width(pool), "output.bmp", 255);
	
	neu::gpu_vector prev_delta(neu::layer::whole_input_size(pool));
	neu::layer::backward(pool, neu::gpu_vector(output.size(), 1.f), prev_delta, queue);<commit_msg>add max_pooling_layer example<commit_after>#include <iostream>
#include <neu/layer/max_pooling.hpp>
#include <neu/image.hpp>
#include <neu/kernel.hpp>

int main() {
	std::cout << "hello world" << std::endl;
	auto& queue = boost::compute::system::default_queue();
	auto context = boost::compute::system::default_context();

	auto batch_size = 1u;
	neu::gpu_vector input;
	for(auto b = 0u; b < batch_size; ++b) {
		auto input_image =
			neu::load_rgb_image_as_3ch_image_vector("../../../data/lena512.bmp");
		auto cpu_input = std::get<0>(input_image);
		input.insert(input.end(), cpu_input.begin(), cpu_input.end());
	}

	neu::layer::geometric_layer_property glp{512, 7, 3, 3, 2, 3};
	auto pool = neu::layer::max_pooling(glp, batch_size, context);

	neu::gpu_vector output(neu::layer::whole_output_size(pool));
	neu::layer::forward(pool, input, output, queue);
	neu::save_3ch_image_vector_as_rgb_image(neu::to_cpu_vector(output, queue),
		neu::layer::output_width(pool), "output.bmp", 255);
	
	neu::gpu_vector prev_delta(neu::layer::whole_input_size(pool));
	neu::layer::backward(pool,
		neu::gpu_vector(output.size(), 1.f, queue), prev_delta, queue);
{'fraction_non_alphanumeric': 0.18433787945446548, 'fraction_numerical': 0.01759788825340959, 'mean_word_length': 7.0638297872340425, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 13, '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': '6120102', 'n_tokens_mistral': 922, 'n_tokens_neox': 862, 'n_words': 142}