Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Nov 7, 2023
1 parent 21cdfd2 commit aa061f2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Binary file modified docs/.DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions playground/silu_visualization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

# SiLU (Sigmoid-weighted Linear Unit) activation function
def silu(x):
return x * (1 / (1 + np.exp(-x)))

# Generate inputs and calculate SiLU outputs
input_values = np.linspace(-10, 10, 100)
output_values = silu(input_values)

# Create 3D plot
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Scatter plot of SiLU outputs
ax.scatter(input_values, output_values, input_values, c=output_values, cmap='viridis')
ax.set_xlabel('Input')
ax.set_ylabel('Output')
ax.set_zlabel('Input')
ax.set_title('3D Visualization of SiLU Activation Function')

plt.show()

0 comments on commit aa061f2

Please sign in to comment.