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
""" | |
Classic cart-pole system implemented by Rich Sutton et al. | |
Copied from http://incompleteideas.net/sutton/book/code/pole.c | |
permalink: https://perma.cc/C9ZM-652R | |
Continuous version by Ian Danforth | |
""" | |
import math | |
import gym |
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
import React, { useMemo, useState } from "react"; | |
import { createEditor, Transforms, Editor } from "slate"; | |
import { Slate, Editable, withReact, ReactEditor } from "slate-react"; | |
import { Box } from "@chakra-ui/react"; | |
const App = () => { | |
const editor = useMemo(() => withReact(createEditor()), []); |
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
def find_indices(condition, list_): | |
return [i for i, x in enumerate(list_) if condition(x)] | |
class Network(nn.Module): | |
def __init__(self, vocab_dim, embed_dim, input_dim, hidden_dim=512): | |
self.embedding = nn.Embedding(vocab_dim, embed_dim) | |
self.rnn = nn.LSTM(embed_dim+input_dim, | |
hidden_dim, | |
batch_first=True) | |
self.out = nn.Linear(hidden_dim, vocab_dim) |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
color: orange |