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

ट्रेंड नेटवर्क से एक kernel निकालना

मॉडल्स को समझने का एक तरीका यह है कि आप convolutional लेयर्स में मौजूद kernels के गुणों की जाँच करें। इस अभ्यास में, आप एक convolutional न्यूरल नेटवर्क से एक kernel निकालेंगे, जिसके वेट्स आपने hdf5 फाइल में सेव किए हैं।

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

Keras के साथ Image Modeling

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

अभ्यास निर्देश

  • फाइल weights.hdf5 से वेट्स मॉडल में लोड कीजिए।
  • मॉडल के layers एट्रिब्यूट से पहली convolutional लेयर लाइए।
  • इस लेयर से वेट्स निकालने के लिए .get_weights() मेथड का उपयोग कीजिए।

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

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

# Load the weights into the model
model.____('weights.hdf5')

# Get the first convolutional layer from the model
c1 = model.____[0]

# Get the weights of the first convolutional layer
weights1 = c1.____()

# Pull out the first channel of the first kernel in the first layer
kernel = weights1[0][...,0, 0]
print(kernel)
कोड संपादित करें और चलाएँ