This file contains 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
use petgraph::{algo::is_isomorphic, graph::NodeIndex, graph::UnGraph}; | |
fn add_possible_edges<T: Clone>(g: UnGraph<T, ()>, num_nodes: usize) -> Vec<UnGraph<T, ()>> { | |
let mut res = Vec::new(); | |
for i in 0..num_nodes - 1 { | |
for j in (i + 1)..num_nodes { | |
if !g.contains_edge(NodeIndex::new(i), NodeIndex::new(j)) { | |
let mut new_g = g.clone(); | |
new_g.add_edge(NodeIndex::new(i), NodeIndex::new(j), ()); | |
res.push(new_g) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# fork from https://github.com/daigo0927/jax-ddim | |
from typing import List, Optional, Sequence, Tuple, Union | |
import haiku as hk | |
import jax | |
import jax.numpy as jnp | |
def sinusoidal_embedding(x, min_freq: float = 1.0, max_freq: float = 1000.0, embedding_dims: int = 32): | |
frequencies = jnp.exp(jnp.linspace(jnp.log(min_freq), jnp.log(max_freq), embedding_dims // 2)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "(lldb) Launch", | |
"type": "cppdbg", | |
"request": "launch", |