def fourier_basis(state): ''' Defines a fourier basis function. ''' basis = np.zeros((BASIS_COUNT,)) scaled = scale_state(state) for i, coeff in enumerate(COEFFS): basis[i] = np.cos(coeff.dot(scaled)) return basis
def polynomial_basis(state): ''' Defines a polynomial basis using the current COEFFS. ''' basis = np.zeros((BASIS_COUNT,)) scaled = scale_state(state) for i, coeff in enumerate(COEFFS): basis[i] = coeff.dot(scaled) basis[0] = 1.0 return basis
def param_features(state): ''' Defines a simple linear set of state variables. ''' array = np.ones(state.size + 1) array[1:] = scale_state(state) array = np.append(array, platform_features(state)) return array