Skip to the content.

Input

In deep learning, input is the raw data you provide to the model so that it can learn or make predictions.

Inputs are usually represented as numerical values, but they can come from various sources like images, text, numbers, audio, or sensor data.


Detailed Explanation:

A neural network (deep learning model) is like a human brain that takes inputs and makes decisions.

In deep learning:


Mathematical View:

\[\large \text{Input} = [x_1, x_2, x_3, ..., x_n]\]

Where:


Types of Inputs:

Type Example
Numeric Age, salary, temperature
Text Sentences, words, documents
Image Pixels (converted to numbers)
Audio Sound waves converted to numerical values
Video Series of image frames + audio

Real-Life Examples:

Real-Life Scenario Input for Deep Learning Model
Predicting house price Size of the house, number of rooms, location, year built
Recognizing handwritten digits Pixels of the image of the digit (0-9)
Language translation Sentence in English (converted to numbers via embeddings)
Voice assistant (like Alexa) Audio of spoken words (converted to numerical features)
Predicting if a customer will buy Age, income, browsing history, past purchases

Example:

Example 1: Cooking Recipe

Example 2: ATM Machine

Example 3: Weather Prediction


Key Points:


import numpy as np

# Step 1: Define the input features (as an array)
# Example: Predicting house price using [size, number_of_rooms, location_score]
inputs = np.array([2000, 3, 8])  # e.g., 2000 sq ft, 3 rooms, location score 8

# Step 2: Define the weights (importance of each input)
weights = np.array([0.5, 0.3, 0.2])  # these are randomly assigned for demonstration

# Step 3: Define bias
bias = 5  # extra adjustment added to the output

# Step 4: Calculate the weighted sum
weighted_sum = np.dot(inputs, weights) + bias

# Step 5: Apply activation function (ReLU used here as example)
def relu(x):
    return max(0, x)

output = relu(weighted_sum)

# Display the result
print(f"Input Features: {inputs}")
print(f"Weights: {weights}")
print(f"Weighted Sum (before activation): {weighted_sum}")
print(f"Output (after ReLU activation): {output}")
Input Features: [2000    3    8]
Weights: [0.5 0.3 0.2]
Weighted Sum (before activation): 1007.5
Output (after ReLU activation): 1007.5