शुरू करेंमुफ़्त में शुरू करें

Keras मॉडल

इस अभ्यास में आप keras.models मॉड्यूल की दो क्लासेज़ का उपयोग करना अभ्यास करेंगे। आप Sequential क्लास से एक मॉडल और Model क्लास से दूसरा मॉडल बनाएँगे.

Sequential क्लास इस्तेमाल करने में आसान है क्योंकि इसमें लेयर्स क्रम में मानी जाती हैं, जबकि Model क्लास ज़्यादा लचीली है और इसमें multiple inputs, multiple outputs और shared layers (shared weights) की सुविधा होती है.

Model क्लास में input layer को स्पष्ट रूप से घोषित करना पड़ता है, जबकि Sequential क्लास में यह काम input_shape पैरामीटर से हो जाता है.

Sequential, Model, Dense, Input, LSTM और np (numpy) ऑब्जेक्ट्स और मॉड्यूल पहले से environment में लोड हैं.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Keras के साथ भाषा मॉडलिंग के लिए Recurrent Neural Networks (RNNs)

पाठ्यक्रम देखें

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Instantiate the class
model = ____(name="sequential_model")

# One LSTM layer (defining the input shape because it is the 
# initial layer)
model.add(____(128, input_shape=(None, 10), name="LSTM"))

# Add a dense layer with one unit
model.add(____(1, activation="sigmoid", name="output"))

# The summary shows the layers and the number of parameters 
# that will be trained
model.____
कोड संपादित करें और चलाएँ