This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[language]] | |
| name = "go" | |
| auto-format = true | |
| formatter = { command = "goimports" } | |
| [[language]] | |
| name = "rust" | |
| auto-format = true | |
| language-servers = ["rust-analyzer"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [[language]] | |
| name = "go" | |
| auto-format = true | |
| formatter = { command = "goimports" } | |
| [[language]] | |
| name = "rust" | |
| auto-format = true | |
| language-servers = ["rust-analyzer"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <!-- | |
| Try this out on: https://mo.town/chordonaut | |
| Prompt: | |
| Create a guitar chord generateor single-page-webapp, in a HTML file called chords.html. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def plot_weights(index, weights=model.get_weights()[0], N=fft_size): | |
| plt.figure(figsize=(9, 3)) | |
| plt.subplot(1, 2, 1) | |
| plt.plot(weights[index][:N]) | |
| plt.plot(weights[index][N:], 'g-') | |
| plt.subplot(1, 2, 2) | |
| plt.plot(weights[fft_size+index][:N]) | |
| plt.plot(weights[fft_size+index][N:], 'g-') | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import tensorflow as tf | |
| batch_size = 15000 | |
| fft_size = 128 | |
| xs = np.random.randn(batch_size, fft_size) + np.random.randn(batch_size, fft_size) * 1j | |
| ys = np.fft.fft(xs, axis=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def plot_weights(index, weights=weights_sxx): | |
| plt.figure(figsize=(15, 2)) | |
| plt.subplot(1, 3, 1) | |
| plt.plot(weights[index][0]) | |
| plt.subplot(1, 3, 2) | |
| plt.plot(weights[index][5]) | |
| plt.subplot(1, 3, 3) | |
| plt.plot(weights[index][10]) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| weights_sxx = model.get_weights()[0] | |
| weights_sxx = np.reshape(weights_sxx, (size, rows * 2, cols)) | |
| weights_sxx = np.moveaxis(weights_sxx, (0,1,2), (2,1,0)) | |
| plt.figure(figsize=(12, 7)) | |
| plt.subplot(2, 2, 1) | |
| plt.pcolormesh(weights_sxx[0], cmap="Accent") | |
| plt.subplot(2, 2, 2) | |
| plt.pcolormesh(weights_sxx[10], cmap="Accent") | |
| plt.subplot(2, 2, 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plt.figure(figsize=(12, 3)) | |
| plt.subplot(1, 2, 1) | |
| plt.pcolormesh(t, f, np.log(wave_sxx_graph)) | |
| plt.subplot(1, 2, 2) | |
| plt.pcolormesh(t, f, np.log(nn_sxx_graph)) | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_wave(): | |
| # Create four evenly-spaced tones | |
| waves = [] | |
| hz = 0 | |
| for i in range(0, size, 512): | |
| hz = hz + 50 | |
| waves.append(np.sin(np.linspace(0, 2 * np.pi * hz, 512))) | |
| return np.hstack(waves) | |
| wave = make_wave() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| size = 2048 | |
| N = 15000 | |
| (xs, ys, rows, cols) = build_training_data(N, size) | |
| model = tf.keras.models.Sequential([ | |
| tf.keras.layers.Dense(rows * cols * 2, input_dim=size, use_bias=False) | |
| ]) |
NewerOlder