Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ImageDataset and Layer for ConvolutionalNeuralNetworks #645

Merged
merged 49 commits into from
May 6, 2024

Conversation

Marsmaennchen221
Copy link
Contributor

@Marsmaennchen221 Marsmaennchen221 commented Apr 23, 2024

Closes #579, #580, #581

Summary of Changes

feat: added Convolutional2DLayer, ConvolutionalTranspose2DLayer, FlattenLayer, MaxPooling2DLayer and AvgPooling2DLayer
feat: added InputConversionImage, OutputConversionImageToColumn, OutputConversionImageToTable and OutputConversionImageToImage
feat: added generic ImageDataset
feat: added class ImageSize and methods ImageList.sizes and Image.size to get the sizes of the respective images
feat: added ability to iterate over SingleSizeImageList
feat: added param to return filenames in ImageList.from_files
feat: added option None for no activation function in ForwardLayer
feat: added Image.__array__ to convert a Image to a numpy.ndarray
feat: added equals check to OneHotEncoder
fix: fixed bug #581 in removing the Softmax function from the last layer in NeuralNetworkClassifier
refactor: move image.utils to image._utils
refactor: extracted test devices from test_image to helpers.devices

feat: added param to return filenames in `ImageList.from_files`
refactor: move `image.utils` to `image._utils`
…-a-new-imagedataset-class

# Conflicts:
#	src/safeds/data/image/containers/_empty_image_list.py
#	src/safeds/data/image/containers/_image_list.py
#	src/safeds/exceptions/__init__.py
…r` and `AvgPooling2DLayer`

feat: added `InputConversionImage` and `OutputConversionImage`
feat: added class `ImageSize` and methods `ImageList.sizes` and `Image.size` to get the sizes of the respective images
feat: added ability to iterate over `SingleSizeImageList`
feat: added option `None` for no activation function in `ForwardLayer`
fix: fixed bug #581 in removing the Softmax function from the last layer in `NeuralNetworkClassifier`
Copy link
Contributor

github-actions bot commented Apr 23, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 44 0 0 2.32s
✅ PYTHON mypy 44 0 3.99s
✅ PYTHON ruff 44 0 0 0.26s
✅ REPOSITORY git_diff yes no 0.38s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@Marsmaennchen221 Marsmaennchen221 linked an issue Apr 23, 2024 that may be closed by this pull request
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cd7f55b) to head (701091b).

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #645    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           66        74     +8     
  Lines         4873      5577   +704     
==========================================
+ Hits          4873      5577   +704     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

refactor: extracted test devices to `helpers.devices`
test: added test for activation function in `ForwardLayer`
test: added test for ImageToTable workflow of a cnn
feat: added `OutputConversionImageToTable` and `OutputConversionImageToImage`
feat: changed `OutputConversionImage` to be intern and abstract with generic `ImageDataset`
feat: added `OutputConversionImageToColumn`
feat: added `ImageDataset` with `Column` as output
feat: added kwargs to abstractmethod `_OutputConversion._data_conversion`
test: added test for cnn workflow to `Image` and `Column` output types
refactor: moved `ImageDataset` to `labeled.containers.ImageDataset`
test: added tests for `ImageDataset`, `InputConversionImage` and all `OutputConversionImage` variants
…2DLayer`, `FlattenLayer`, `MaxPooling2DLayer` and `AvgPooling2DLayer`
test: added additional tests for codecov
docs: added docstrings
…-a-new-imagedataset-class

# Conflicts:
#	src/safeds/data/labeled/containers/__init__.py
#	src/safeds/exceptions/_ml.py
#	src/safeds/ml/nn/_input_conversion.py
#	src/safeds/ml/nn/_model.py
#	src/safeds/ml/nn/_output_conversion.py
#	src/safeds/ml/nn/_output_conversion_table.py
#	tests/safeds/ml/nn/test_model.py
@Marsmaennchen221 Marsmaennchen221 marked this pull request as ready for review May 1, 2024 23:25
@Marsmaennchen221 Marsmaennchen221 requested a review from a team as a code owner May 1, 2024 23:25
Marsmaennchen221 and others added 4 commits May 6, 2024 16:40
…-a-new-imagedataset-class

# Conflicts:
#	src/safeds/data/image/containers/_single_size_image_list.py
#	src/safeds/data/tabular/transformation/_one_hot_encoder.py
@lars-reimann lars-reimann merged commit 5b6d219 into main May 6, 2024
10 checks passed
@lars-reimann lars-reimann deleted the 579-add-a-new-imagedataset-class branch May 6, 2024 16:05
lars-reimann pushed a commit that referenced this pull request May 9, 2024
## [0.24.0](v0.23.0...v0.24.0) (2024-05-09)

### Features

* `Column.plot_histogram()` using `Table.plot_histograms` for consistent results ([#726](#726)) ([576492c](576492c))
* `Regressor.summarize_metrics` and `Classifier.summarize_metrics` ([#729](#729)) ([1cc14b1](1cc14b1)), closes [#713](#713)
* `Table.keep_only_rows` ([#721](#721)) ([923a6c2](923a6c2))
* `Table.remove_rows` ([#720](#720)) ([a1cdaef](a1cdaef)), closes [#698](#698)
* Add `ImageDataset` and Layer for ConvolutionalNeuralNetworks ([#645](#645)) ([5b6d219](5b6d219)), closes [#579](#579) [#580](#580) [#581](#581)
* added load_percentage parameter to ImageList.from_files to load a subset of the given files ([#739](#739)) ([0564b52](0564b52)), closes [#736](#736)
* added rnn layer and TimeSeries conversion ([#615](#615)) ([6cad203](6cad203)), closes [#614](#614) [#648](#648) [#656](#656) [#601](#601)
* Basic implementation of cell with polars ([#734](#734)) ([004630b](004630b)), closes [#712](#712)
* deprecate `Table.add_column` and `Table.add_row` ([#723](#723)) ([5dd9d02](5dd9d02)), closes [#722](#722)
* deprecated `Table.from_excel_file` and `Table.to_excel_file` ([#728](#728)) ([c89e0bf](c89e0bf)), closes [#727](#727)
* Larger histogram plot if table only has one column ([#716](#716)) ([31ffd12](31ffd12))
* polars implementation of a column ([#738](#738)) ([732aa48](732aa48)), closes [#712](#712)
* polars implementation of a row ([#733](#733)) ([ff627f6](ff627f6)), closes [#712](#712)
* polars implementation of table ([#744](#744)) ([fc49895](fc49895)), closes [#638](#638) [#641](#641) [#649](#649) [#712](#712)
* regularization for decision trees and random forests ([#730](#730)) ([102de2d](102de2d)), closes [#700](#700)
* Remove device information in image class ([#735](#735)) ([d783caa](d783caa)), closes [#524](#524)
* return fitted transformer and transformed table from `fit_and_transform` ([#724](#724)) ([2960d35](2960d35)), closes [#613](#613)

### Bug Fixes

* make `Image.clone` internal ([#725](#725)) ([215a472](215a472)), closes [#626](#626)

### Performance Improvements

* improved performance of `TabularDataset.__eq__` by a factor of up to 2 ([#697](#697)) ([cd7f55b](cd7f55b))
@lars-reimann
Copy link
Member

🎉 This PR is included in version 0.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Included in a release
Projects
None yet
4 participants