Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
# Callback function to check model accuracy
class RayCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs.get('accuracy')>0.998):
print("\nReached 99.8% accuracy so cancelling training!")
self.model.stop_training = True
# Load the MNIST handwrite digit data set
Epoch 1/15
1875/1875 [==============================] - 3s 2ms/step - loss: 0.2570 - accuracy: 0.9265
Epoch 2/15
1875/1875 [==============================] - 4s 2ms/step - loss: 0.1133 - accuracy: 0.9667
Epoch 3/15
1875/1875 [==============================] - 3s 2ms/step - loss: 0.0778 - accuracy: 0.9765
Epoch 4/15
1875/1875 [==============================] - 3s 2ms/step - loss: 0.0580 - accuracy: 0.9822
Epoch 5/15
1875/1875 [==============================] - 3s 2ms/step - loss: 0.0444 - accuracy: 0.9859
import tensorflow as tf
# Callback function to check model accuracy
class RayCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs={}):
if(logs.get('accuracy')>0.99):
print("\nReached 99% accuracy so cancelling training!")
self.model.stop_training = True
# Load the MNIST handwrite digit data set
import tensorflow as tf
iport numpy as np
from tensorflow import keras
# Create an 1*1 layer neuron
model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])])
# Setting optimizer and loss function
model.compile(optimizer='sgd', loss='mean_squared_error')
# Training data
utils.importFile("../../../../../src/common/cc26xx/kernel/cc2640/config/cc2640.cfg");
/*
* Extend the cc2640 configuration
*/
var SysStd = xdc.useModule("xdc.runtime.SysStd");
var System = xdc.useModule("xdc.runtime.System");
System.SupportProxy = SysStd;
System.extendedFormats = '%$L%$S%$F%f';
int 8_t b = -10; // b = 0xf6 for 2's complement
b = b << 1; // b=0xec
b = b >> 1; // Now b = 0x76 and for demical b = 118 unexpect ouput
// The correct way to do that operation
b = b&0x80 | b>>1;// b = 0xf6 for demical b = 10
int 8_t b = -10; // b = 0xf6 for 2's complement
b = b << 1; // b=0xec
b = b >> 1; // Now b = 0x76 and for demical b = 118 unexpect ouput
python C:\Python27\Scripts\hexmerge.py -o .\SOMETHING_MERGED.hex -r 0000:1FFFF .\SOMETHING_APP.hex:0000:1FFFF .\SOMETHING_STACK.hex --overlap=error
// Copyright 2017 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"log"
"os"
package main
import (
"fmt"
"log"
"time"
"golang.org/x/sys/windows/registry"
)