dictionaries an matrices

joseph pareti joepareti54 at gmail.com
Wed Sep 16 08:56:35 EDT 2020


you can use the following: (change the matrices as it suits your app):

import numpy as np
def set_params(w, b):

        params = {"w0": w[0], "w1": w[1] , "w2": w[2], "w3": w[3], "w4":
w[4], "b": b}

        return params

w = np.random.randn((5))
b = 1
params = set_params(w, b)
for i in range(5):
        W = params.get("w"+str(i))
        print(W)
B = params.get('b')
print(B)

Am Mi., 16. Sept. 2020 um 13:14 Uhr schrieb Ing Diegohl <
ingdiegohl at gmail.com>:

> Good morning everyone
> I would like to know if i can to create a dictionary with two matrices,
> where every element of the first matrix corresponds to dictionary's keys
> and the elements of the second matrix will be the values every key.
> thanks
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Regards,
Joseph Pareti - Artificial Intelligence consultant
Joseph Pareti's AI Consulting Services
https://www.joepareti54-ai.com/
cell +49 1520 1600 209
cell +39 339 797 0644


More information about the Python-list mailing list