code stringlengths 3 6.57k |
|---|
ChipUtility.CStringToString(moduleName) |
ChipUtility.CStringToString(message) |
LogCategory.categoryToLogLevel(logCat) |
self.logger.log(logLevel, message, extra=msgAttrs) |
setLogFunct(self, logFunct) |
timestamp (integer) |
timestampUS (integer) |
name (encoded UTF-8 string) |
category (integer) |
message (encoded UTF-8 string) |
isinstance(logFunct, _LogMessageFunct) |
_LogMessageFunct(logFunct) |
self._ChipStackLib.pychip_Stack_SetLogFunct(logFunct) |
Shutdown(self) |
self._ChipStack.Call(lambda: self._dmLib.pychip_Stack_Shutdown() |
Call(self, callFunct) |
self.completeEvent.clear() |
callFunct() |
self.completeEvent.set() |
CallAsync(self, callFunct) |
self.completeEvent.clear() |
callFunct() |
self.completeEvent.set() |
self.ErrorToException(res) |
self.completeEvent.isSet() |
self.blockingCB() |
self.completeEvent.wait(0.05) |
isinstance(self.callbackRes, ChipStackException) |
ErrorToException(self, err, devStatusPtr=None) |
if (devStatus.SysErrorCode != 0) |
self._ChipStackLib.pychip_Stack_ErrorToString(err) |
LocateChipDLL(self) |
os.path.dirname(os.path.abspath(__file__) |
os.path.join(scriptDir, ChipStackDLLBaseName) |
os.path.exists(dmDLLPath) |
platform.machine() |
platform.system() |
lower() |
self._AllDirsToRoot(scriptDir) |
os.path.join(dir, relDMDLLPathGlob) |
glob.glob(dmDLLPathGlob) |
os.path.exists(dmDLLPath) |
DLL (%s) |
_AllDirsToRoot(self, dir) |
os.path.abspath(dir) |
os.path.dirname(dir) |
_loadLib(self) |
CDLL(self.LocateChipDLL() |
int(((INPUT_SHAPE[0] - 2*int(FILTER_SIZE_1[0]/2) |
int(FILTER_SIZE_2[0]/2) |
int(((INPUT_SHAPE[1] - 2*int(FILTER_SIZE_1[0]/2) |
int(FILTER_SIZE_2[0]/2) |
gym.make('SpaceInvaders-v0') |
np.zeros((6,1) |
visualize(featureVector) |
reshape((210,160) |
reshape((210,160) |
PLT.imshow(regularImage) |
PLT.show() |
PLT.imshow(differenceImage) |
PLT.show() |
writeCsv(index, data) |
open("logs.csv", "w", newline='') |
csv.writer(csv_file, delimiter=',') |
writer.writerows(slack_logs) |
calculatePolicySize() |
initPopulation() |
np.random.rand(POPULATION_SIZE, calculatePolicySize() |
convert_prediction_to_action(prediction) |
np.argmax(prediction[0]) |
if (index == 0) |
elif (index == 1) |
elif (index == 2) |
elif (index == 3) |
playGame(model) |
np.zeros((1,FRAME_SIZE) |
np.zeros((1,FRAME_SIZE) |
env.reset() |
list(INPUT_SHAPE) |
observation_dim.insert(0,1) |
tuple(observation_dim) |
env.render() |
env.step(action) |
np.reshape(observation[:,:,0],(1,FRAME_SIZE) |
np.where(frame > 0, 1.0,0) |
np.zeros((1,INPUT_DIM) |
np.reshape(final_observation, observation_dim) |
model.predict(final_observation) |
convert_prediction_to_action(prediction) |
writeCsv(2, score) |
np.copy(frame) |
print("Score:",score) |
evaluate(dnnmodel, population, gamesPlayed) |
np.zeros(POPULATION_SIZE) |
range(POPULATION_SIZE) |
applyPolicyVectorToNN(population[i]) |
dnnmodel.set_weights(nnFormatPolicyVector) |
playGame(dnnmodel) |
writeCsv(3, gamesPlayed) |
buildModel() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.