• what is Warm-up: numpy.

    Warm-up: numpy / উষ্ণতা: অদ্ভুত

    ইউক্লিডিয়ান ত্রুটি ব্যবহার করে এক্স থেকে y এর পূর্বাভাস দেওয়ার জন্য প্রশিক্ষিত একটি গোপন স্তর এবং কোনও বায়াসহ সম্পূর্ণরূপে সংযুক্ত রিলু নেটওয়ার্ক।
    এই বাস্তবায়নটি ফরোয়ার্ড পাস, হ্রাস এবং পশ্চাদপদ পাসের ম্যানুয়ালি গণনা করতে নকল ব্যবহার করে।
    একটি numpy array is a generic n-dimensional arrayএটি deep learning or gradients or computational graphগুলি সম্পর্কে কিছুই জানে না এবং এটি জেনেরিক সংখ্যার গণনা সম্পাদনের একটি উপায়।
    import numpy as np
    
    # N is batch size; D_in is input dimension;
    # H is hidden dimension; D_out is output dimension.
    N, D_in, H, D_out = 64, 1000, 100, 10
    
    # Create random input and output data
    x = np.random.randn(N, D_in)
    y = np.random.randn(N, D_out)
    
    # Randomly initialize weights
    w1 = np.random.randn(D_in, H)
    w2 = np.random.randn(H, D_out)
    
    learning_rate = 1e-6
    for t in range(500):
        # Forward pass: compute predicted y
        h = x.dot(w1)
        h_relu = np.maximum(h, 0)
        y_pred = h_relu.dot(w2)
    
        # Compute and print loss
        loss = np.square(y_pred - y).sum()
        print(t, loss)
    
        # Backprop to compute gradients of w1 and w2 with respect to loss
        grad_y_pred = 2.0 * (y_pred - y)
        grad_w2 = h_relu.T.dot(grad_y_pred)
        grad_h_relu = grad_y_pred.dot(w2.T)
        grad_h = grad_h_relu.copy()
        grad_h[h < 0] = 0
        grad_w1 = x.T.dot(grad_h)
    
        # Update weights
        w1 -= learning_rate * grad_w1
        w2 -= learning_rate * grad_w2
    স্ক্রিপ্টের মোট চলমান সময়: (0 মিনিট 0.000 সেকেন্ড)

  • 0 comments:

    Post a Comment

    New Research

    Attention Mechanism Based Multi Feature Fusion Forest for Hyperspectral Image Classification.

    CBS-GAN: A Band Selection Based Generative Adversarial Net for Hyperspectral Sample Generation.

    Multi-feature Fusion based Deep Forest for Hyperspectral Image Classification.

    ADDRESS

    388 Lumo Rd, Hongshan, Wuhan, Hubei, China

    EMAIL

    contact-m.zamanb@yahoo.com
    mostofa.zaman@cug.edu.cn

    TELEPHONE

    #
    #

    MOBILE

    +8615527370302,
    +8807171546477