<jupyter_start><jupyter_text>IntroYou don't directly choose the numbers to go into your convolutions for deep learning... instead the deep learning technique determines what convolutions will be useful from the data (as part of model-training). We'll come back to how the model does that soon.![Imgur](https://i.imgur.com/op9Maqr.png)But looking closely at convolutions and how they are applied to your image will improve your intuition for these models, how they work, and how to debug them when they don't work.**Let's get started.** ExercisesWe'll use some small utilty functions to visualize raw images and some results of your code. Execute the next cell to load the utility functions.<jupyter_code># Set up code checking
from learntools.core import binder
binder.bind(globals())
from learntools.deep_learning.exercise_1 import *
print("Setup Complete")<jupyter_output><empty_output><jupyter_text>Exercise 1In the video, you saw a convolution that detected horizontal lines. That convolution shows up again in the code cell below.Run the cell to see a raw image as well as the output from applying this convolution to the image.<jupyter_code>horizontal_line_conv = [[1, 1], 
                        [-1, -1]]
# load_my_image and visualize_conv are utility functions provided for this exercise
original_image = load_my_image() 
visualize_conv(original_image, horizontal_line_conv)<jupyter_output><empty_output><jupyter_text>Now it's your turn. Instead of a horizontal line detector, you will create a vertical line detector.**Replace the underscores with numbers to make a vertical line detector and uncomment both lines of code in the cell below. Then run **<jupyter_code>vertical_line_conv = ____

q_1.check()
visualize_conv(original_image, vertical_line_conv)<jupyter_output><empty_output><jupyter_text>If you'd like a hint or the solution, uncomment the appropriate line below.<jupyter_code>#_COMMENT_IF(PROD)_
q_1.hint()
#q_1.solution()
#%%RM_IF(PROD)%%

vertical_line_conv = [[1, -1],
                      [1, -1]]

q_1.assert_check_passed()

vertical_line_conv = [[1, 1],
                      [1, 1]]

q_1.assert_check_failed()<jupyter_output><empty_output><jupyter_text>Exercise 2The convolutions you've seen are 2x2.  But you could have larger convolutions. They could be 3x3, 4x4, etc.  They don't even have to be square. Nothing prevents using a 4x7 convolution.Compare the number of visual patterns that can be captured by small convolutions. Which of the following is true?- There are more visual patterns that can be captured by large convolutions- There are fewer visual patterns that can be captured by large convolutions- The number of visual patterns that can be captured by large convolutions is the same as the number of visual patterns that can be captured by small convolutions?Once you think you know the answer, check it by uncommenting and running the line below.<jupyter_code>#_COMMENT_IF(PROD)_
q_2.solution()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06763122476446837, 'fraction_numerical': 0.010094212651413189, 'mean_word_length': 5.06734693877551, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, '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}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '164270', 'license': 'Apache-2.0', 'n_tokens_mistral': 856, 'n_tokens_neox': 813, 'n_words': 358, 'path': 'notebooks/deep_learning/raw/ex1_convolutions.ipynb', 'repo_name': 'stephenramthun/learntools', 'size': '2972'}