1 Tensorflow: The insdustry standard
import tensorflow as tf x = tf.constant([[1.0, 2.0], [3.0, 4.0]]) y = tf.constant([[5.0, 6.0], [7.0, 8.0]]) result = tf.matmul(x, y) print(result)
Output:
tf.Tensor(
[[19. 22.]
[43. 50.]], shape=(2, 2), dtype=float32)
2. Pytocrh- Reasearchers favourite
import torch
x-torch.tensor([[1.,2.],[3.,4.]])
y=torch.tensor([[2.,0.],[0.,2.]])
print(torch.mm(x,y))
Output:
tensor([[2., 4.],
[6., 8.]])
3. Kera- The beginner deep learning Friend
from tensorflow import keras
from tensorflow.keras import layers
model=keras.Sequential([
keras.Input(shape=(3,)),
layers.Dense(4,activation='relu'),
layers.Dense(1)
])
model.summary()
Output:


0 Comments:
Post a Comment