View play_bipedal.py
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 | |
from tinynet import RNN1L | |
import gym | |
pre_trained_weights = np.array( | |
[[-6.42131474e-02, 1.18558117e+00, -8.65697398e-02, | |
-7.25508614e-01, -1.64208890e+00, 2.36031412e-01, | |
-2.30686547e-01, 1.01184284e-02, 9.14193609e-02, | |
4.09360317e-01, 5.28414810e-01, 3.01208252e+00, | |
-9.78603700e-02, 3.53038690e-02, 8.94094020e-01, |
View words.rb
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 process_words | |
# Lowercase | |
words.each &:downcase! | |
# Remove punctuation | |
words.map! { |word| word.gsub(/[^a-z0-9\s]/i, '') } | |
# Remove numbers | |
words.map! { |word| word.gsub(/[0-9]/i, '') } | |
# Remove empty and single-letter words | |
words.reject! { |word| word.length < 2 } | |
# Remove stopwords |