Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:42:34+00:00 2026-05-30T02:42:34+00:00

I ve got two matrices W2 and hiddenLayer and i want to proceed the

  • 0

I ve got two matrices W2 and hiddenLayer and i want to proceed the multiplication of those. W2 size’s 12×50 and hiddenLayer size’s 50×1. The proper code for the above calculation:

 for(int h=0; h<50; h++){
      for(int k=0; k<12; k++){
        outputLayer += W2[k][h]*HiddenLayer[h];
      }
}

or i ve got to put at first k-for??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:42:36+00:00Added an answer on May 30, 2026 at 2:42 am

    Matrix multiplication is defined as:

    C = AB ⇔ Ci,j = Σk=1..n Ai,k Bk,j for i,j = 1...n (in case of square matrices).

    Thus outputLayer is a vector. Since HiddenLayer is a vector too, this isn’t really a matrix multiplication but a matrix vector multiplication, which simplifies the formula above:

    b = Ax ⇔ bi = Σk=1..m Ai,k xk for i = 1...n (A is an n x m matrix).

    So all in all your code should be something like

    for(int row = 0; row < 12; row++){
        outputLayer[row] = 0;
        for(int column = 0;  column < 50; column++){    
            outputLayer[row] += W2[row][column]*HiddenLayer[column];
          }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my code...I have two dimensional matrices A,B. I want to develop the
I got two projects running, both written in PHP. Now I want to merge
I've got two classes, ProductConfiguration and SubProduct. I want to replace the subproducts on
I got two sets of points S and V, both have the size n.
I got two tables one below the other. I want to move it up
I've got two input boxes in a div, I want to hide that div
I have two matrices ( x1 and x2 ) with same size. I would
Got two applications running on tomcat: Application1 (JSP) Application2 (Webservices) I want to set
I got two errors after I compiled my code. The errors are: 1. local
I've got two controls in my Interface Builder file, and each of those controls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.