एक्टिवेशन फंक्शन

Python में TensorFlow परिचय

Isaiah Hull

Visiting Associate Professor of Finance, BI Norwegian Business School

एक्टिवेशन फंक्शन क्या है?

  • टिपिकल हिडन लेयर के कॉम्पोनेन्ट
    • लिनियर: मैट्रिक्स मल्टिप्लिकेशन
    • नॉनलिनियर: एक्टिवेशन फंक्शन
Python में TensorFlow परिचय

नॉनलिनियरिटी क्यों ज़रूरी हैं

यह इमेज एक सिंपल नेटवर्क दिखाती है जहाँ bill amount और age से default प्रेडिक्ट करते हैं.

Python में TensorFlow परिचय

नॉनलिनियरिटी क्यों ज़रूरी हैं

यह इमेज 30 या कम उम्र के उधारकर्ताओं के लिए credit card bill amount और default का संबंध दिखाती है.

Python में TensorFlow परिचय

एक सरल उदाहरण

import numpy as np
import tensorflow as tf

# Define example borrower features
young, old = 0.3, 0.6
low_bill, high_bill = 0.1, 0.5
# Apply matrix multiplication step for all feature combinations
young_high = 1.0*young + 2.0*high_bill
young_low = 1.0*young + 2.0*low_bill
old_high = 1.0*old + 2.0*high_bill
old_low = 1.0*old + 2.0*low_bill
Python में TensorFlow परिचय

एक सरल उदाहरण

# Difference in default predictions for young
print(young_high - young_low)

# Difference in default predictions for old
print(old_high - old_low)
0.8 
0.8
Python में TensorFlow परिचय

एक सरल उदाहरण

# Difference in default predictions for young
print(tf.keras.activations.sigmoid(young_high).numpy() - 
tf.keras.activations.sigmoid(young_low).numpy())

# Difference in default predictions for old
print(tf.keras.activations.sigmoid(old_high).numpy() - 
tf.keras.activations.sigmoid(old_low).numpy())
0.16337568
0.14204389
Python में TensorFlow परिचय

Sigmoid एक्टिवेशन फंक्शन

  • Sigmoid एक्टिवेशन फंक्शन
    • बायनरी क्लासिफिकेशन
    • लो-लेवल: tf.keras.activations.sigmoid()
    • हाई-लेवल: sigmoid

यह इमेज -10 से 10 इंटरवल पर sigmoid एक्टिवेशन फंक्शन का प्लॉट दिखाती है.

Python में TensorFlow परिचय

ReLU एक्टिवेशन फंक्शन

  • ReLU एक्टिवेशन फंक्शन
    • हिडन लेयर्स
    • लो-लेवल: tf.keras.activations.relu()
    • हाई-लेवल: relu

यह इमेज -10 से 10 इंटरवल पर relu एक्टिवेशन फंक्शन का प्लॉट दिखाती है.

Python में TensorFlow परिचय

Softmax एक्टिवेशन फंक्शन

  • Softmax एक्टिवेशन फंक्शन
    • आउटपुट लेयर (>2 क्लास)
    • लो-लेवल: tf.keras.activations.softmax()
    • हाई-लेवल: softmax
Python में TensorFlow परिचय

न्यूरल नेटवर्क में एक्टिवेशन फंक्शन

import tensorflow as tf
# Define input layer
inputs = tf.constant(borrower_features, tf.float32)
# Define dense layer 1
dense1 = tf.keras.layers.Dense(16, activation='relu')(inputs)
# Define dense layer 2
dense2 = tf.keras.layers.Dense(8, activation='sigmoid')(dense1)
# Define output layer 
outputs = tf.keras.layers.Dense(4, activation='softmax')(dense2)
Python में TensorFlow परिचय

अभ्यास करते हैं!

Python में TensorFlow परिचय

Preparing Video For Download...