I hereby claim:
- I am kengz on github.
- I am kengz (https://keybase.io/kengz) on keybase.
- I have a public key ASCZnM1pXJ3J3XW9-Nk2h22qWrep6ra1BfxuN6YBZFTbggo
To claim this, I am signing this object:
| The HEX color for Atom highlighter theme: close to Base16 but lighter. | |
| bgdark: #2b303b | |
| red: #e26a78 | |
| cyan: #78dbf9 | |
| green: #8bdb97 | |
| purple: #d59cf6 | |
| orange: #dbad83 |
| # First create a Google Compute Engine (GCE) VM instance, then SSH into the VM. | |
| # 1. update everything | |
| sudo apt-get update | |
| # 2. install these 4 things | |
| sudo apt-get install python g++ make checkinstall | |
| # 3. make a src directory and go into it | |
| mkdir ~/src && cd $_ |
| # Deploying NodeJS App on Google Cloud Platform | |
| `authored Jul 3 2015 by kengz` | |
| ## Installation | |
| - Account with Google Cloud Platform. | |
| - Install [Google Cloud Platform SDK](https://cloud.google.com/sdk/) to use `cloud` in the terminal. | |
| - Install [Docker](https://cloud.google.com/tutorials/install-docker) for the VM container. | |
| - Locally, login for the first time: `gcloud auth login` |
| Global Hackers Missions | |
| [ Feel free to contribute and sign your own contribution! Separate by “Insert > Horizontal line”. See example below. ] | |
| [ Anyone can edit this document, so be responsible. Of course we back this up somewhere else too | |
| ### | |
| This page is for doers who dare to, and for builders who want to, make a dent in the universe. | |
| Do's: Be open minded, be dare, believe. | |
| Don’t be butt-hurt, don’t be evil. |
I hereby claim:
To claim this, I am signing this object:
| def post_body_init(self): | |
| '''Initializes the part of algorithm needing a body to exist first.''' | |
| self.body = self.agent.nanflat_body_a[0] # single-body algo | |
| # create the extra replay memory for SIL | |
| memory_name = self.memory_spec['sil_replay_name'] | |
| MemoryClass = getattr(memory, memory_name) | |
| self.body.replay_memory = MemoryClass(self.memory_spec, self, self.body) | |
| self.init_algorithm_params() | |
| self.init_nets() | |
| logger.info(util.self_desc(self)) |
| def train_shared(self): | |
| ''' | |
| Trains the network when the actor and critic share parameters | |
| ''' | |
| if self.to_train == 1: | |
| # onpolicy a2c update | |
| a2c_loss = super(SIL, self).train_shared() | |
| # offpolicy sil update with random minibatch | |
| total_sil_loss = torch.tensor(0.0) | |
| for _ in range(self.training_epoch): |
| def calc_sil_policy_val_loss(self, batch): | |
| ''' | |
| Calculate the SIL policy losses for actor and critic | |
| sil_policy_loss = -log_prob * max(R - v_pred, 0) | |
| sil_val_loss = norm(max(R - v_pred, 0)) / 2 | |
| This is called on a randomly-sample batch from experience replay | |
| ''' | |
| returns = math_util.calc_returns(batch, self.gamma) | |
| v_preds = self.calc_v(batch['states']) | |
| clipped_advs = torch.clamp(returns - v_preds, min=0.0) |
See https://kengz.gitbooks.io/slm-lab/content/installation/installation.html for full instruction.
git clone https://github.com/kengz/SLM-Lab.git
cd SLM-Lab
| # init singleton agent and env | |
| self.env = make_env(self.spec) | |
| body = Body(self.env, self.spec['agent']) | |
| self.agent = Agent(self.spec, self.info_space, body=body) |