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
-- | |
require 'cudnn' | |
require 'cunn' | |
torch.setdefaulttensortype('torch.FloatTensor') | |
-- Get weight dim | |
function checkSums(rnn, seqLength, batch, inputDim, hiddenSize, layerNum, bidirectional) | |
rnn:reset() |
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
marketCap | ||
---|---|---|
MMM | 78989082624 | |
ABT | 142520418304 | |
ABBV | 112197386240 | |
ABMD | 6640275968 | |
ACN | 106709229568 | |
ATVI | 44837953536 | |
ADBE | 152021614592 | |
AMD | 55831867392 | |
AAP | 6676629504 |
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
// Build with with `-O` and `Whole Module optimization` flags | |
import Dispatch | |
import Foundation | |
import OpenSpiel | |
func playRandomGame<T: GameProtocol>(_ game: T) { | |
var state = game.initialState | |
while !state.isTerminal { | |
state.apply(state.legalActions.randomElement()!) |
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 numpy as np | |
import pyspiel | |
import time | |
def play_random_game(game): | |
game_state = game.new_initial_state() | |
while not game_state.is_terminal(): | |
random_action = np.random.choice(game_state.legal_actions()) | |
game_state.apply_action(random_action) |
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
"""Pseudocode description of the AlphaZero algorithm. | |
Original taken from 'Data S1' from https://science.sciencemag.org/content/362/6419/1140/tab-figures-data/ | |
""" | |
from __future__ import google_type_annotations | |
from __future__ import division | |
import math | |
import numpy |