delete unused utils
This commit is contained in:
parent
9c801f0adc
commit
cdb2472ac7
@ -18,16 +18,6 @@ import datetime
|
|||||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||||
dataType = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
|
dataType = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor
|
||||||
|
|
||||||
class Utils():
|
|
||||||
def prepro(self, I):
|
|
||||||
I = I[35:195] # crop
|
|
||||||
I = I[::2,::2, 0] # downsample by factor of 2
|
|
||||||
I[I == 144] = 0 # erase background (background type 1)
|
|
||||||
I[I == 109] = 0 # erase background (background type 2)
|
|
||||||
I[I != 0] = 1 # everything else (paddles, ball) just set to 1
|
|
||||||
X = I.astype(np.float32).ravel() # Combine items in 1 array
|
|
||||||
return X
|
|
||||||
|
|
||||||
class Actor_Model(nn.Module):
|
class Actor_Model(nn.Module):
|
||||||
def __init__(self, state_dim, action_dim):
|
def __init__(self, state_dim, action_dim):
|
||||||
super(Actor_Model, self).__init__()
|
super(Actor_Model, self).__init__()
|
||||||
|
@ -11,16 +11,6 @@ import numpy as np
|
|||||||
import sys
|
import sys
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
class Utils():
|
|
||||||
def prepro(self, I):
|
|
||||||
I = I[35:195] # crop
|
|
||||||
I = I[::2,::2, 0] # downsample by factor of 2
|
|
||||||
I[I == 144] = 0 # erase background (background type 1)
|
|
||||||
I[I == 109] = 0 # erase background (background type 2)
|
|
||||||
I[I != 0] = 1 # everything else (paddles, ball) just set to 1
|
|
||||||
X = I.astype(np.float32).ravel() # Combine items in 1 array
|
|
||||||
return X
|
|
||||||
|
|
||||||
class Actor_Model(Model):
|
class Actor_Model(Model):
|
||||||
def __init__(self, state_dim, action_dim):
|
def __init__(self, state_dim, action_dim):
|
||||||
super(Actor_Model, self).__init__()
|
super(Actor_Model, self).__init__()
|
||||||
|
@ -11,16 +11,6 @@ import numpy as np
|
|||||||
import sys
|
import sys
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
class Utils():
|
|
||||||
def prepro(self, I):
|
|
||||||
I = I[35:195] # crop
|
|
||||||
I = I[::2,::2, 0] # downsample by factor of 2
|
|
||||||
I[I == 144] = 0 # erase background (background type 1)
|
|
||||||
I[I == 109] = 0 # erase background (background type 2)
|
|
||||||
I[I != 0] = 1 # everything else (paddles, ball) just set to 1
|
|
||||||
X = I.astype(np.float32).ravel() # Combine items in 1 array
|
|
||||||
return X
|
|
||||||
|
|
||||||
class Actor_Model(Model):
|
class Actor_Model(Model):
|
||||||
def __init__(self, state_dim, action_dim):
|
def __init__(self, state_dim, action_dim):
|
||||||
super(Actor_Model, self).__init__()
|
super(Actor_Model, self).__init__()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user