Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
RubyAM committed Dec 10, 2024
1 parent b2ac9d9 commit 3c21b35
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: |
sonar-scanner \
-Dsonar.cfamily.compile-commands="build_wrapper_output_directory/build-wrapper-dump.json"
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
14 changes: 7 additions & 7 deletions examples/mnist/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ int main()
const Index channels = 1;
const Index targets = 2;

//ImageDataSet image_data_set(samples_number, {image_height, image_width, channels}, {targets});
ImageDataSet image_data_set(samples_number, {image_height, image_width, channels}, {targets});

//image_data_set.set_image_data_random();
image_data_set.set_image_data_random();

//image_data_set.set(DataSet::SampleUse::Training);
image_data_set.set(DataSet::SampleUse::Training);

ImageDataSet image_data_set(0,{0,0,0},{0});
//ImageDataSet image_data_set(0,{0,0,0},{0});

//image_data_set.set_data_path("data");
//image_data_set.set_data_path("C:/mnist/train");
image_data_set.set_data_path("C:/binary_mnist");
//image_data_set.set_data_path("C:/binary_mnist");
//image_data_set.set_data_path("C:/Users/Roberto Lopez/Documents/opennn/examples/mnist/data");
//image_data_set.set_data_path("C:/melanoma_dataset_bmp");
//image_data_set.set_data_path("C:/melanoma_dataset_bmp_small");
//image_data_set.set_data_path("C:/melanoma_supersmall");
//image_data_set.set_input_dimensions({24,24,1});

image_data_set.read_bmp();
//image_data_set.read_bmp();

// Neural network

NeuralNetwork neural_network(NeuralNetwork::ModelType::ImageClassification,
image_data_set.get_input_dimensions(),
{ 16 },
{ 1 },
image_data_set.get_target_dimensions());

//neural_network.print();
Expand Down
14 changes: 7 additions & 7 deletions opennn/neural_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,17 +424,17 @@ void NeuralNetwork::set_image_classification(const dimensions& input_dimensions,
const dimensions convolution_stride_dimensions = { 1, 1 };
const ConvolutionalLayer::ConvolutionType convolution_type = ConvolutionalLayer::ConvolutionType::Valid;

add_layer(make_unique<ConvolutionalLayer>(get_output_dimensions(),
kernel_dimensions,
ConvolutionalLayer::ActivationFunction::RectifiedLinear,
convolution_stride_dimensions,
convolution_type,
"convolutional_layer_" + to_string(i+1)));
//add_layer(make_unique<ConvolutionalLayer>(get_output_dimensions(),
// kernel_dimensions,
// ConvolutionalLayer::ActivationFunction::RectifiedLinear,
// convolution_stride_dimensions,
// convolution_type,
// "convolutional_layer_" + to_string(i+1)));

const dimensions pool_dimensions = { 2, 2 };
const dimensions pooling_stride_dimensions = { 2, 2 };
const dimensions padding_dimensions = { 0, 0 };
const PoolingLayer::PoolingMethod pooling_method = PoolingLayer::PoolingMethod::AveragePooling;
const PoolingLayer::PoolingMethod pooling_method = PoolingLayer::PoolingMethod::MaxPooling;

add_layer(make_unique<PoolingLayer>(get_output_dimensions(),
pool_dimensions,
Expand Down
4 changes: 1 addition & 3 deletions opennn/pooling_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ void PoolingLayer::set_pooling_method(const string& new_pooling_method)
}



void PoolingLayer::forward_propagate(const vector<pair<type*, dimensions>>& input_pairs,
unique_ptr<LayerForwardPropagation>& layer_forward_propagation,
const bool& is_training)
Expand Down Expand Up @@ -351,8 +350,7 @@ void PoolingLayer::forward_propagate_max_pooling(const Tensor<type, 4>& inputs,

const Eigen::array<Index, 2> reshape_dimensions = { pool_size, output_size };

#pragma omp parallel for

#pragma omp parallel for
for (Index batch_index = 0; batch_index < batch_samples_number; batch_index++)
{
const Tensor<type, 2> patches_flat = image_patches.chip(batch_index, 0)
Expand Down

0 comments on commit 3c21b35

Please sign in to comment.