This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all my code related to loss: | |
loss = tf.losses.softmax_cross_entropy(onehot_labels=labels, logits=logits) | |
total_loss = tf.losses.get_total_loss() | |
... | |
train_step = slim.learning.create_train_op(total_loss, optimizer, variables_to_train=variables_to_train) #better than Optimizer.minimize because it prevents problems like vanishing gradient | |
... | |
#this is writing everything to tensorboard | |
tf.summary.scalar('total loss', total_loss) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import io | |
def extract_annotations(path): | |
image = io.imread("data/cowc/datasets/ground_truth_sets/Toronto_ISPRS/03559_Annotated_Cars.png") | |
print('%d, %d' % (image.shape[0], image.shape[1])) | |
i = 1; | |
for x in range(0, image.shape[0]): | |
for y in range(0, image.shape[1]): | |
if image[x][y][0] > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://medium.com/initialized-capital/we-need-to-go-deeper-a-practical-guide-to-tensorflow-and-inception-50e66281804f | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets('data/mnist', one_hot=True) | |
from tensorflow.contrib.slim.nets import inception as nn_architecture | |
from tensorflow.contrib import slim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string shaderCode = ""; | |
std::ifstream codeStream(shaderPath, std::ios::in); | |
if (codeStream.is_open()) | |
{ | |
std::string line = ""; | |
while (getline(codeStream, line)) | |
shaderCode += "\n" + line; | |
codeStream.close(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected boolean isAvailable() { | |
if (getActivity() == null) return false; | |
if (getActivity().isFinishing()) return false; | |
if (!isAdded()) return false; | |
if (isDetached()) return false; | |
if (!isVisible()) return false; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"FileVersion": 3, | |
"EngineAssociation": "4.10", | |
"Category": "", | |
"Description": "", | |
"Modules": [ | |
{ | |
"Name": "Asteroids", | |
"Type": "Runtime", | |
"LoadingPhase": "Default", |