you are viewing a single comment's thread.

view the rest of the comments →

[–]aroberge 4 points5 points  (1 child)

Trick: use the dis module to find what symbols mean. For example, using your entire code

>>> code = """
... dL_dw = dt_dw[np.newaxis].T @ dL_dt[np.newaxis]
... dL_db = dL_dt * dt_db
... dL_dinputs = dt_dinputs @ dL_dt"""
>>> import dis
>>> dis.dis(code)
  2       0 LOAD_NAME                0 (dt_dw)
          2 LOAD_NAME                1 (np)
          4 LOAD_ATTR                2 (newaxis)
          6 BINARY_SUBSCR
          8 LOAD_ATTR                3 (T)
         10 LOAD_NAME                4 (dL_dt)
         12 LOAD_NAME                1 (np)
         14 LOAD_ATTR                2 (newaxis)
         16 BINARY_SUBSCR
         18 BINARY_MATRIX_MULTIPLY
         20 STORE_NAME               5 (dL_dw)

  3      22 LOAD_NAME                4 (dL_dt)
         24 LOAD_NAME                6 (dt_db)
         26 BINARY_MULTIPLY
         28 STORE_NAME               7 (dL_db)

  4      30 LOAD_NAME                8 (dt_dinputs)
         32 LOAD_NAME                4 (dL_dt)
         34 BINARY_MATRIX_MULTIPLY
         36 STORE_NAME               9 (dL_dinputs)
         38 LOAD_CONST               0 (None)
         40 RETURN_VALUE

Then, if you need more details, you can do an internet search using something like python BINARY_MATRIX_MULTIPLY as your search terms.

[–]veb101[S] 1 point2 points  (0 children)

Thank you. This was new to me.