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
| builtin_data <- data()$results[, "Item"] | |
| builtin_df_names <- builtin_data %>% | |
| purrr::set_names() %>% | |
| purrr::map(purrr::possibly(get, otherwise = NULL)) %>% | |
| purrr::keep(is.data.frame) %>% | |
| purrr::map(names) %>% | |
| purrr::compact() |
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
| colors <- c("red", "green", "yellow") | |
| vehicles <- c("bicycle", "car", "submarine", "airplane") | |
| colored_vehicles <- purrr::cross2(colors, vehicles) %>% | |
| purrr::map_chr(~paste(.[[1]], .[[2]])) |
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
| colors <- c("red", "green", "yellow") | |
| vehicles <- c("bicycle", "car", "submarine", "airplane") | |
| colored_vehicles <- colors %>% | |
| purrr::map(function(color) { | |
| purrr::map_chr(vehicles, ~paste(color, .)) | |
| }) %>% | |
| purrr::flatten() %>% | |
| unlist() |
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
| animals <- c("lion", "tiger", "rhinoceros") | |
| animal_nchars <- animals %>% | |
| purrr::set_names() %>% | |
| purrr::map(nchar) |
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
| Blood of Eden is made up of humans that left earth before the resurrection. Their "eden" is the earth itself, and they seek "revenge for the 10 billion" | |
| The 10 billion are the humans who were left on Earth when the resurrection - presumably following some extinction event - occurred. | |
| John orchestrated the extinction in order to ascend to godhood. By killing all life in the solar system, he created the 9 resurrection beasts. | |
| Alecto is the resurrection beast of Earth, which John made into his cavalier and performed perfect Lyctorhood with. | |
| So John is basically a super-lyctor powered by the soul of a planet, rather than of another human. |
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 plotly.graph_objects as go | |
| import plotly.express as px | |
| def make_barpolar(vals, labels=None, colors=None, layout_options = None, **fig_kwargs): | |
| # infer slice angles | |
| num_slices = len(vals) | |
| theta = [(i + 1.5) * 360 / num_slices for i in range(num_slices)] | |
| width = [360 / num_slices for _ in range(num_slices)] | |
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 | |
| from tf.keras.regularizers import l2 | |
| def build_nn(input_shape, | |
| hidden_units=(20, 20), | |
| output_size=1, | |
| output_activation=None, | |
| hidden_activation=tf.nn.relu, | |
| dropout=0.0, | |
| regularization=0.0): |
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 | |
| def build_nn(input_shape, hidden_units=(20, 20), output_size=1, output_activation=None): | |
| inputs = tf.keras.Input(shape=input_shape) | |
| hidden = inputs | |
| for layer_units in hidden_units: | |
| hidden = tf.keras.layers.Dense(layer_units, activation=tf.nn.relu)(hidden) | |
| outputs = tf.keras.layers.Dense(output_size, activation=output_activation)(hidden) |
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 | |
| from mpl_toolkits import mplot3d | |
| def plot_surface(domain, fn, grid_samples=100, title=None, **plot_kwargs): | |
| x = np.linspace(domain[0][0], domain[0][1], grid_samples) | |
| y = np.linspace(domain[1][0], domain[1][1], grid_samples) | |
| X, Y = np.meshgrid(x, y) | |
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 | |
| from mpl_toolkits import mplot3d | |
| def plot_surface(domain, fn, title=None, grid_samples=100): | |
| x = np.linspace(domain[0][0], domain[0][1], grid_samples) | |
| y = np.linspace(domain[1][0], domain[1][1], grid_samples) | |
| X, Y = np.meshgrid(x, y) | |
NewerOlder