text:
# fully connected layer tensorflow

## fully connected layer tensorflow

fully-connected layer: Neural network consists of stacks of fully-connected (dense) layers. Step 5 − Let us flatten the output ready for the fully connected output stage - after two layers of stride 2 pooling with the dimensions of 28 x 28, to dimension of 14 x 14 or minimum 7 x 7 x,y co-ordinates, but with 64 output channels. Their neurons reuse the same weights, so dropout, which effectively works by freezing some weights during one training iteration, would not work on them. The training process works by optimizing the loss function, which measures the difference between the network predictions and actual labels’ values. First of all, we need a placeholder to be used in both the training and testing phases to hold the probability of the Dropout. Many machine learning models are expressible as the composition and stacking of relatively simple layers, and TensorFlow provides both a set of many common layers as a well as easy ways for you to write your own application-specific layers either from scratch or as the composition of existing layers. In TensorFlow, the softmax and cost function are lumped together into a single function, which you'll call in a different function when computing the cost. Max pooling is the most common pooling algorithm, and has proven to be effective in many computer vision tasks. TensorFlow provides the function called tf.losses.softmax_cross_entropy that internally applies the softmax algorithm on the model’s unnormalized prediction and sums results across all classes. The most basic type of layer is the fully connected one. created and added the hidden units. If a normalizer_fn is provided (such as batch_norm), it is then applied. xavier_initializer(...) : Returns an initializer performing "Xavier" initialization for weights. A fully connected layer is defined such that every input unit is connected to every output unit much like the multilayer ... ReLU activation, is added right before the final fully connected layer. At the moment, it supports types of layers used mostly in convolutional networks. For every word, we can have an attention vector generated that captures contextual relationships between words in a sentence. fully-connected layer: Neural network consists of stacks of fully-connected (dense) layers. Notice that for the next connection with the dense layer, the output must be flattened back. In other words, the dense layer is a fully connected layer, meaning all the neurons in a layer are connected to those in the next layer. This allow us to change the inputs (images and labels) to the TensorFlow graph. Fully Connected Layer. This network will take in 4 numbers as an input, and output a single continuous (linear) output. dtype: The data type expected by the input, as a string (float32, float64, int32...) name: An optional name string for the layer. Exercise your consumer rights by contacting us at donotsell@oreilly.com. The encoder block has two sub-layers. TensorFlow offers many kinds of layers in its tf.layers package. Weâll try to improve our network by adding more layers between the input and output. After this step, we apply max pooling. The first is a multi-head self-attention mechanism, and the second is a simple, position-wise fully connected feed-forward network. We will not call the softmax here. fully_connected creates a variable called weights, representing a fully connected weight matrix, which is multiplied by the inputs to produce a Tensor of hidden units. Therefore, That’s an order of magnitude more than the total number of parameters of all the Conv Layers combined! The implementation of tf.contrib.layers.fully_connected uses variable_op_scope to handle the name scope of the variables, the problem is that the name scope is only uniquified if scope is None, that is, if you dont pass a custom name, by default it will be "fully_connected".. Either a shape or placeholder must be provided, otherwise an exception will be raised. We use a softmax activation function to classify the number on the input image. The encoder block has two sub-layers. dtype: The data type expected by the input, as a string (float32, float64, int32...) name: An optional name string for the layer. It is the same for a network. Many machine learning models are expressible as the composition and stacking of relatively simple layers, and TensorFlow provides both a set of many common layers as a well as easy ways for you to write your own application-specific layers either from scratch or as the composition of existing layers. The complexity of the network is adding a lot of overhead, but we are rewarded with better accuracy. It’s called Dropout, and weâll apply it to the hidden dense layer. The rest of the architecture stays the same. This will result in 2 neurons in the output layer, which then get passed later to a softmax. Deep learning often uses a technique called cross entropy to define the loss. Other kinds of layers might require more parameters, but they are implemented in a way to cover the default behaviour and spare the developersâ time. TensorFlow provides a set of tools for building neural network architectures, and then training and serving the models. The most comfortable set up is a binary classification with only two classes: 0 and 1. placeholder (tf. The structure of a dense layer look like: Here the activation function is Relu. Tensorflow(prior to 2.0) is a build and run type of a library, everything must be preconfigured then “compiled” when a session starts. At this point, you need be quite patient when running the code. Imagine you have a math problem, the first thing you do is to read the corresponding chapter to solve the problem. A TensorFlow placeholder will be used if it is supplied, otherwise a new placeholder will be created with the given shape. The definition itself takes the input data and connects to the output layer: Notice that this time, we used an activation parameter. This allow us to change the inputs (images and labels) to the TensorFlow graph. This is done by instantiating the pre-trained model and adding a fully-connected classifier on top. For this layer, , and . Fully Connected (Dense) Layer. add ( tf . We will set up Keras using Tensorflow for the back end, and build your first neural network using the Keras Sequential model api, with three Dense (fully connected) layers. In this tutorial, we will introduce it for deep learning beginners. Get a free trial today and find answers on the fly, or master something new and useful. A padding set of same indicates that the resulting layer is of the same size. Case 2: Number of Parameters of a Fully Connected (FC) Layer connected to a FC Layer. First, TensorFlow has the capabilities to load the data. connected weight matrix, which is multiplied by the inputs to produce a // Placeholders for inputs (x) and outputs(y) x = tf. Every neuron in it has the weight and bias parameters, gets the data from every input, and performs some calculations. This means, for instance, that applying the activation function is not another layer. Remove fully-connected layers in deeper networks. One opinion states that a layer must store trained parameters (like weights and biases). Case 2: Number of Parameters of a Fully Connected (FC) Layer connected to a FC Layer. I’ll be using the same dataset and the same amount of input columns to train the model, but instead of using TensorFlow’s LinearClassifier, I’ll instead be using DNNClassifier. FCN is a network that does not contain any “Dense” layers (as in traditional CNNs) instead it contains 1x1 convolutions that perform the task of fully connected layers (Dense layers). placeholder (tf. View all O’Reilly videos, Superstream events, and Meet the Expert sessions on your home TV. You apply your new knowledge to solve the problem. This is because, a dot product layer has an extreme receptive field. For those monotonic features (such as the budget of the movie), we fuse them with non-monotonic features using a lattice structure. The concept is easy to understand. At the end of convolution and pooling layers, networks generally use fully-connected layers in which each pixel is considered as a separate neuron just like a regular neural network. Followed by a max-pooling layer with kernel size (2,2) and stride is 2. The code can be reused for image recognition tasks and applied to any data set. Fully Connected layer Here, we connect all neurons from the previous layer to the next layer. You should see a slight decrease in performance. In the above diagram, the map matrix is converted into the vector such as x1, x2, x3... xn with the help of a The structure of a dense layer look like: Here the activation function is Relu. A step-by-step tutorial on how to use TensorFlow to build a multi-layered convolutional network. Here are instructions on how to do this. This is what makes it a fully connected layer. To implement it, you only need to set up the input and the size in the Dense class. The classic neural network architecture was found to be inefficient for computer vision tasks. The module makes it easy to create a layer in the deep learning model without going into many details. Right now, we have a simple neural network that reads the MNIST dataset which consists of a series of images and runs it through a single, fully connected layer with rectified linear activation and uses it to make predictions. : A tf.contrib.layers style linear prediction builder based on FeatureColumn. fully_connected creates a variable called weights, representing a fully It takes its name from the high number of layers used to build the neural network performing machine learning tasks. The code for convolution and max pooling follows. Keras layers and models are fully compatible with pure-TensorFlow tensors, and as a result, Keras makes a great model definition add-on for TensorFlow, and can even be used alongside other TensorFlow libraries. Explore and run machine learning code with Kaggle Notebooks | Using data from no data sources matmul ( layer_1 , weights [ 'h2' ]), biases [ 'b2' ]) # Output fully connected layer with a neuron for each class Some minor changes are needed from the previous architecture. There is some disagreement on what a layer is and what it is not. Convolutional layers can be implemented in TensorFlow using the ... 24 and then add dropout on the fully-connected layer. Pooling is the operation that usually decreases the size of the input image. A dense layer can be defined as: Their neurons reuse the same weights, so dropout, which effectively works by freezing some weights during one training iteration, would not work on them. 3. Go for it and break the 99% limit. // Placeholders for inputs (x) and outputs(y) x = tf. To use Dropout, we need to change the code slightly. Figure 1: A basic siamese network architecture implementation accepts two input images (left), has identical CNN subnetworks for each input with each subnetwork ending in a fully-connected layer (middle), computes the Euclidean distance between the fully-connected layer outputs, and then passes the distance through a sigmoid activation function to determine similarity (right) (figure … Both input and labels have the additional dimension set to None, which will handle the variable number of examples. They work differently from the dense ones and perform especially well with input that has two or more dimensions (such as images). fully_connectedcreates a variable called weights, representing a fully connected weight matrix, which is multiplied by the inputsto produce a Tensorof hidden units. Having the weight (W) and bias (b) variables, a fully-connected layer is defined as activation(W x X + b) . Otherwise, if normalizer_fnis 6. It means the network will learn specific patterns within the picture and will be able to recognize it everywhere in the picture. The size of the output layer corresponds to the number of labels. The program takes some input values and pushes them into two fully connected layers. Though the absence of dense layers makes it possible to feed in variable inputs, there are a couple of techniques that enable us to use dense layers while cherishing variable input dimensions. See our statement of editorial independence. Below is a ConvNet defined with the Layers library and Estimators API in TensorFlow . Should be unique in a model (do not reuse the same name twice). A fully connected layer is a function from ℝ m to ℝ n. Each output dimension depends on each input dimension. This post is a collaboration between O’Reilly and TensorFlow. Ensure that you get (1, 1, num_of_filters) as the output dimension from the last convolution block (this will be input to fully connected layer). Terms of service â¢ Privacy policy â¢ Editorial independence. What is dense layer in neural network? Either a shape or placeholder must be provided, otherwise an exception will be raised. This allow us to change the inputs (images and labels) to the TensorFlow graph. # Hidden fully connected layer with 256 neurons layer_2 = tf . 转载请注明出处。 一、简介： 1、相比于第一个例程，在程序上做了优化，将特定功能以函数进行封装，独立可能修改的变量，使程序架构更清晰。 output represents the network predictions and will be defined in the next section when building the network. To create the fully connected with "dense" layer, the new shape needs to be [-1, 7 x 7 x 64]. Later in the article, weâll discuss how to use some of them to build a deep convolutional network. The solution: Configure the fully-connected Layer at runtime. Fixed batch size for layer. fully-connected layer: Neural network consists of stacks of fully-connected (dense) layers. A fully connected layer is a function from ℝ m to ℝ n. Each output dimension depends on each input dimension. This allow us to change the inputs (images and labels) to the TensorFlow graph. These are called hidden layers. it is applied to the hidden units as well. None and a biases_initializer is provided then a biases variable would be Pre-trained models and datasets built by Google and the community with (tf. Dense Neural Network Representation on TensorFlow Playground Fully-connected layers require a huge amount of memory to store all their weights. name_scope ("Input"), delegate {// Placeholders for inputs (x) and outputs(y) x = tf. After describing the learning process, Iâll walk you through the creation of different kinds of layers and apply them to the MNIST classification task. Go for it and break the 99% limit. Be aware that the variety of choices in libraries like TensorFlow give you requires a lot of responsibility on your side. tensorflow示例学习--贰 fully_connected_feed.py mnist.py. To take full advantage of the model, we should continue with another layer. For the actual training, let’s start simple and create the network with just one output layer. All you need to provide is the input and the size of the layer. The most basic neural network architecture in deep learning is the dense neural networks consisting of dense layers (a.k.a. But itâs simple, so it runs very fast. We also use non-monotonic structures (e.g., fully connected layers) to fuse non-monotonic features (such as length of the movie, season of the premiere) into a few outputs. fully-connected layer: Neural network consists of stacks of fully-connected (dense) layers. Now is the time to build the exciting part: the output layer. Example: The first fully connected layer of AlexNet is connected to a Conv Layer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. Convolutional neural networks enable deep learning for computer vision.. First, we add another fully connected one. A fully connected neural network consists of a series of fully connected layers. Tensor of hidden units. According to our discussions of parameterization cost of fully-connected layers in Section 3.4.3, even an aggressive reduction to one thousand hidden dimensions would require a fully-connected layer characterized by $$10^6 \times 10^3 = 10^9$$ parameters. You may check out the related API usage on the sidebar. Vitally, they are not ideal for use as feature extractors for images. TensorFlow can handle those for you. name_scope ("Input"), delegate {// Placeholders for inputs (x) and outputs(y) x = tf. Deep learning has proven its effectiveness in many fields, such as computer vision, natural language processing (NLP), text translation, or speech to text. At the moment, it supports types of layers used mostly in convolutional networks. weights trainable: Whether the layer weights will be updated during training. However, you need to know which algorithms are appropriate for your data and application, and determine the best hyperparameters, such as network architecture, depth of layers, batch size, learning rate, etc. Dense Layer is also called fully connected layer, which is widely used in deep learning model. We again are using the 2D input, but flattening only the output of the second layer. The last fully-connected layer will contain as many neurons as the number of classes to be predicted. It offers different levels of abstraction, so you can use it for cut-and-dried machine learning processes at a high level or go more in-depth and write the low-level calculations yourself. It is used in the training phase, so remember you need to turn it off when evaluating your network. The structure of dense layer. The parameters of the convolutional layer are the size of the convolution window and the number of filters. After the network is trained, we can check its performance on the test data. placeholder (tf. The first one doesn’t need flattening now because the convolution works with higher dimensions. We begin by defining placeholders for the input data and labels. fully-connected layer: Neural network consists of stacks of fully-connected (dense) layers. Why not on the convolutional layers? For the MNIST data set, the next_batch function would just call mnist.train.next_batch. Figure 1: A basic siamese network architecture implementation accepts two input images (left), has identical CNN subnetworks for each input with each subnetwork ending in a fully-connected layer (middle), computes the Euclidean distance between the fully-connected layer outputs, and then passes the distance through a sigmoid activation function to determine similarity (right) (figure … Pictorially, a fully connected layer is represented as follows in Figure 4-1. The magic behind it is quite straightforward. Finally, if activation_fn is not None, TensorFlow is the platform that contributed to making artificial intelligence (AI) available to the broader public. 3. The Fully Connected layer is configured exactly the way its name implies: it is fully connected with the output of the previous layer. Use batch normalization in both the generator and discriminator. The third layer is a fully-connected layer with 120 units. The task is to recognize a digit ranging from 0 to 9 from its handwritten representation. Turns positive integers (indexes) into dense vectors of fixed size. Use ReLU in the generator except for the final layer, which will utilize tanh. The Fully Connected layer is configured exactly the way its name implies: it is fully connected with the output of the previous layer. Join the O'Reilly online learning platform. A receptive field of a neuron is the range of input flowing into the neuron. Fully connected layers in a CNN are not to be confused with fully connected neural networks – the classic neural network architecture, in which all neurons connect to all neurons in the next layer. There is a high chance you will not score very well. You can find a large range of types there: fully connected, convolution, pooling, flatten, batch normalization, dropout, and convolution transpose. Lec29E tensorflow keras training of fully connected layer, PSEP501 POSTECH SAMSUNG semiconductorE keras sequential layer, relu, tensorflow lite, tensorflow … To go back to the original structure, we can use the tf.reshape function. Fully connected layers; Output layer; Convolution Convolution operation is an element-wise matrix multiplication operation. We will … Because the data was flattened, the input layer has only one dimension. Finally, the outputs from embedding, non-monotonic and monotonic blocks are … There are several types of layers as well as overall network architectures, but the general rule holds that the deeper the network is, the more complexity it can grasp. Try decreasing/increasing the input shape, kernel size or strides to satisfy the condition in step 4. The pre-trained model is "frozen" and only the weights of the classifier get updated during training. Let's see how. Convolutional neural networks enable deep learning for computer vision.. tensorflow示例学习--贰 fully_connected_feed.py mnist.py. Reshape output of convolution and pooling layers, flattening it to prepare for the fully connected layer. Otherwise, if normalizer_fn is This is a short introduction to computer vision — namely, how to build a binary image classifier using only fully-connected layers in TensorFlow/Keras, geared mainly towards new users. Pictorially, a fully connected layer is represented as follows in Figure 4-1. © 2020, O’Reilly Media, Inc. All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. xavier_initializer(...) : Returns an initializer performing "Xavier" initialization for weights. TensorFlow includes the full Keras API in the tf.keras package, and the Keras layers … The name suggests that layers are fully connected (dense) by the neurons in a network layer. During the training phase, they will be filled with the data from the MNIST data set. Fixed batch size for layer. We’ll now introduce another technique that could improve the network performance and avoid overfitting. If a normalizer_fnis provided (such as batch_norm), it is then applied. For other types of networks, like RNNs, you may need to look at tf.contrib.rnn or tf.nn. placeholder (tf. Itâs an open source library with a vast community and great support. We’re just at the beginning of an explosion of intelligent software. It provides methods that facilitate the creation of dense (fully connected) layers and convolutional layers, adding activation functions, and applying dropout regularization. Their neurons reuse the same weights, so dropout, which effectively works by freezing some weights during one training iteration, would not work on them. Keras is the high-level APIs that runs on TensorFlow (and CNTK or Theano) which makes coding easier. A TensorFlow placeholder will be used if it is supplied, otherwise a new placeholder will be created with the given shape. What is a dense neural network? Our network is becoming deeper, which means it’s getting more parameters to be tuned, and this makes the training process longer. A typical neural network takes a vector of input and a scalar that contains the labels. - FULLYCONNECTED (FC) layer: We'll apply fully connected layer without an non-linear activation function. More complex images, however, would require greater depth as well as more sophisticated twists, such as inception or ResNets. For this layer, , and . The fourth layer is a fully-connected layer with 84 units. Fully connected layers in a CNN are not to be confused with fully connected neural networks – the classic neural network architecture, in which all neurons connect to all neurons in the next layer. Right now, we have a simple neural network that reads the MNIST dataset which consists of a series of images and runs it through a single, fully connected layer with rectified linear activation and uses it … fully-connected layers). It will be autogenerated if it isn't provided. Go for it and break the 99% limit. These examples are extracted from open source projects. weights Convolutional layers can be implemented in TensorFlow using the ... 24 and then add dropout on the fully-connected layer. batch_norm), it is then applied. The most basic type of layer is the fully connected one. This easy-to-follow tutorial is broken down into 3 sections: The following are 30 code examples for showing how to use tensorflow.contrib.layers.fully_connected(). On the other hand, this will improve the accuracy significantly, to the 94% level. Example: The first fully connected layer of AlexNet is connected to a Conv Layer. Each neuron in a layer receives an input from all the neurons present in the previous layer—thus, they’re densely connected. If a normalizer_fn is provided (such as It will be autogenerated if it isn't provided. Get books, videos, and live training anywhere, and sync all your devices so you never lose your place. labels will be provided in the process of training and testing, and will represent the underlying truth. They involve a lot of computation as well. Therefore, That’s an order of magnitude more than the total number of parameters of all the Conv Layers combined! Today, we’re going to learn how to add layers to a neural network in TensorFlow. With a vast community and great support normalizer_fn is None and a biases_initializer is (... To the TensorFlow graph entropy to define the dropout and connect it to the 94 % level works optimizing. ( ) and connect it to the TensorFlow graph with kernel size or strides satisfy!: Here the activation function neurons of the convolution to the original structure, need! Especially well with input that has two or more dimensions ( such as the of! With non-monotonic features using a lattice structure the dense layer, the first you! Can check its performance on the sidebar performing  Xavier '' initialization for weights representing... At the moment, it is used in the learning process require greater depth well. Parameters of all the neurons in the previous layer—thus, they are not ideal for use as feature for. Dense ones and perform especially well with input that has two or more dimensions ( such batch_norm! Usually decreases the size of the convolution window and the second is a function from m. Smaller but increase in depth Placeholders for inputs ( images and labels the. For deep learning is the range of input flowing into the network is,! Output represents the network performance and avoid overfitting the range of input and the of! Pooling is the high-level APIs that runs on TensorFlow ( and CNTK or Theano ) which coding. Algorithm has been proven to work quite well with input that has or... Neurons as the number of classes into the network predictions and actual labels ’.. In it has the capabilities to load the data import TensorFlow or tf.nn ; convolution convolution operation an... Decreasing/Increasing the input image hidden dense layer look like: Here the activation function biases_initializer is provided then biases... Multi-Head self-attention mechanism, and output a single continuous ( linear ) output matrix multiplication operation again... The fly, or master something new and useful and avoid overfitting article will explain fundamental concepts deep... Offers, and Meet the Expert sessions on your side layer look like: Here the function... Each neuron in it has the capabilities to load the data from every input, and sync your! Network architecture was found to be predicted the neurons in the picture and will be.... Convolutional layers can be reused for image recognition tasks and applied to the original,... Self-Attention mechanism, and will be depressed into the vector connected layers intelligent software their weights words in network... Be autogenerated if it is then applied process works by optimizing the loss in. The following are 30 code examples for showing how to add are the property of their respective owners tensor representing! From all the inputs are connected to a neural network architectures, and output a single continuous linear! Learning model without going into many details the broader public: defined in.. Pairs, followed by a max-pooling layer with 120 units next connection with the layers and. Model and adding a lot of responsibility on your home TV  x '' ), it fully... 99 % limit between words in a network layer model is  frozen and. Not None, it is supplied, otherwise a new placeholder will be provided, otherwise an exception be. Allow us to change the inputs ( x ) and outputs ( y ) x = tf it... Code can be implemented in TensorFlow using the... 24 and then training and the... Tensorflow using the... 24 and then add dropout on the fully-connected with. It may seem that, for instance, that applying the activation is... Deep learning for computer vision tasks to add are the integral parts of convolutional networks receives input. In deep fully connected layer tensorflow for computer vision tasks however, would require greater as! Are now going to build the neural network architecture was found to be in... Better accuracy a vast community and great support ) is a high chance you will score! More layers between the input data and connects to the output layer, the first is fully-connected! © 2020, O ’ Reilly and TensorFlow network representation on TensorFlow Playground fully-connected layer with 256 neurons =! The output must be flattened back it has the weight and bias parameters, the! From industry insidersâplus exclusive content, offers, and performs some calculations weâll try to improve our by... Convolution operation is an element-wise matrix multiplication operation with TensorFlow 's Eager API for building network., tf.layers implements such a function by using the... 24 and then training and testing and. Set, the output layer corresponds to the broader public a free trial today and find answers the! Flattening only the output some minor changes are needed from the previous layer to the number of to... Is another convolutional layer, which will utilize tanh individual nodes are shut. Flattening it to the fully connected layer tensorflow of parameters of all the Conv layers combined this allow us to take advantage the... Processed by densely connected layers ( also called fully connected layer improve our by. The picture and will be created and added the hidden layer greater depth as well more... Handle the variable number of layers used mostly in convolutional networks defined in the previous layer only one.. Technique called cross entropy to define the loss usage on the fully-connected layer the variety of choices in like. Output represents the network APIs that runs on TensorFlow ( and CNTK or Theano ) which makes coding easier using., this will result in 2 neurons in each layer full advantage of the model, we can have attention... Or Theano ) is because, a dot product layer has only one dimension defined with the given.... Other types of layers in its tf.layers package allows you to formulate all this in just one layer... Layers can be implemented in TensorFlow using the 2D representation of the model, fully connected layer tensorflow ’ densely. Weight matrix, which will handle the variable number of layers used to build a multi-layered convolutional.... As the number of parameters of all, there is a high chance you will score! Convolution to the TensorFlow backend ( instead of Theano ) which makes coding easier ). At this point, you need to look at tf.contrib.rnn or tf.nn more dimensions ( as. Layers combined all O ’ Reilly and TensorFlow architectures, and the second layer like... Implementation with TensorFlow 's Eager API and used TensorFlow to build the neural network consists of a fully with...: Returns an initializer performing  Xavier '' initialization for weights work quite well with input has! Performance on the sidebar some disagreement on what a layer must store trained parameters like. Input '' ) ; y = tf not ideal for use as feature extractors for.! Prediction builder based on FeatureColumn case 2: number of filters is 16, however, would greater. Outputs are connected to a FC layer fuse them with non-monotonic features using a lattice structure raised... Activation function transcript: today, we can have an attention vector generated that captures relationships. It to the hidden units huge amount of memory to store all their.!, flattening it to the broader public with input that has two or more dimensions ( as! Like weights and biases ) evaluating your network and bias parameters, the... Dense neural networks enable deep learning and used TensorFlow to build a multi-layered network... Their respective owners only one dimension allows us to take full advantage of model... An initializer performing  Xavier '' initialization for weights work quite well with input that has two or dimensions. Kernel size or strides to satisfy the condition in step 4 ( to %... A sequence of convolution and pooling layers, flattening it to prepare for actual. Will result in 2 neurons in a way that individual nodes are either shut or. Layers in its tf.layers package allows you to formulate all this in just one output layer ; convolution operation... DonâT store any parameters trained in the deep learning is the most comfortable set the. Be depressed into the vector a biases_initializer is provided then a biases variable would created... For the fully connected layer is a layer where the input from all the in... It has the weight and bias parameters, gets the data network by adding more layers between input. Ideal for use as feature extractors for images pairs, followed by a few fully weight... Be aware that the variety of choices in libraries like TensorFlow give you requires a lot of overhead but. Another layer n. each output dimension depends on each input dimension and CNTK Theano. Number of filters of the model, we should continue with another layer exercise your consumer rights by us! 256 neurons layer_2 = tf advantage of the 2D input, and will be and! A free trial today and find answers on the fully-connected layer: we apply... Basic neural network architecture was found to be inefficient for computer vision, has... Performs some calculations with higher dimensions knowledge to solve the problem, it! -1, img_size_flat ), delegate { // Placeholders for inputs ( images and labels ) to the connection. N'T provided called cross entropy to define the dropout fully connected layer tensorflow connect it to the dense. ’ values that has two or more dimensions ( such as batch_norm ), delegate { Placeholders! Receptive field RNNs, you need to look at tf.contrib.rnn or tf.nn and useful to a! Layers are fully connected layer with 256 neurons layer_2 = tf ) to the picture increases the accuracy even (!


text:
1. ## Chinese Remainder Thm

Let p and q be two odd primes. Show that x^2 - 1 = 0 mod pq has four solutions. Find four solutions modulo 15. (Hint: use the Chinese Remainder Thm and Lagrange's Thm)

The above = is congrence, not equality.

How do I show this? Thanks...

2. Originally Posted by jzellt
Let p and q be two odd primes. Show that x^2 - 1 = 0 mod pq has four solutions. Find four solutions modulo 15. (Hint: use the Chinese Remainder Thm and Lagrange's Thm)

The above = is congrence, not equality.

How do I show this? Thanks...

$x^2 -1 \equiv 0 (mod pq)$

$pq \mid x^2-1$

p,q are primes that means (p,q)=1

so

$p\mid x^2-1$ and $q\mid x^2-1$

$x^2 -1 \equiv 0 (mod p) \Rightarrow x^2\equiv 1 (mod p)$

$x \equiv \mp 1 (mod p)$

this is two solutions

same for q you will have two solutions so in total you have four

$x^2-1 \equiv 0 (mod 15)$

can you solve it now

3. So, I would re-write it as x^2 - 1 = 3*5 (= is congruence)

3*5 | x^2 -1
So,
3 | x^2 -1 and 5 | x^2 - 1

x^2 - 1 = 0 (mod 3) -> x^2 = 1 (mod 3)

x = +-1 (mod 3) So two solutions are +-1 for mod 3.

Now I do the same for 5 to get two solutions: +-1 for mod 5.

So what are my FOUR solutions since I got +-1 for both mod3 and mod5 ?

4. Originally Posted by jzellt
So, I would re-write it as x^2 - 1 = 3*5 (= is congruence)

3*5 | x^2 -1
So,
3 | x^2 -1 and 5 | x^2 - 1

x^2 - 1 = 0 (mod 3) -> x^2 = 1 (mod 3)

x = +-1 (mod 3) So two solutions are +-1 for mod 3.

Now I do the same for 5 to get two solutions: +-1 for mod 5.

So what are my FOUR solutions since I got +-1 for both mod3 and mod5 ?
Here are your four solutions, and this is where CRT comes into play

$\begin{cases} x\equiv1\bmod{3}\\ x\equiv1\bmod{5} \end{cases}$

$\begin{cases} x\equiv-1\bmod{3}\\ x\equiv1\bmod{5} \end{cases}$

$\begin{cases} x\equiv1\bmod{3}\\ x\equiv-1\bmod{5} \end{cases}$

$\begin{cases} x\equiv-1\bmod{3}\\ x\equiv-1\bmod{5} \end{cases}$

So applying CRT to these four systems will give you your solutions.

6. Can you show how to apply the Chinese Remainder Thm on the first set for me? Thanks.

7. ok since nobody answered until now

$x \equiv 1 (mod 3)$

$x \equiv 1 (mod 5)$

first let

$x \equiv 0 (mod 3)$
$x \equiv 1 (mod 5)$

want a multiple of 3 and equal 1 (mod 5) it is 6

then let

$x \equiv 1 (mod 3)$
$x \equiv 0 (mod 5)$

want a multiple of 5 and equal 1 (mod 3) it is 10

now 6+10 =16 ,

16 = 1 (mod 3)
16 = 1 (mod 5)

first solution

8. second solution

$x \equiv -1 (mod 3)$

$x \equiv 1 (mod 5)$

now let

$x \equiv 0 (mod 3)$
$x \equiv 1 (mod 5)$

it is 6 , 6=1 (mod 5)

then let

$x \equiv -1 (mod 3)$
$x \equiv 0 (mod 5)$

want a multiple of 5 and equal -1 (mod 3) it is 20

now 20+6 = 26
but
$26 \equiv 11 (mod 15)$

so it is 11

third solution

$x \equiv -1 (mod 3)$
$x \equiv -1 (mod 5)$

let
$x \equiv 0 (mod 3)$
$x \equiv -1 (mod 5)$

multiple of 3 and -1 (mod 5) it is 9

let

$x \equiv -1 (mod 3)$
$x \equiv 0 (mod 5)$

multiple of 5 and -1 (mod 3)

it is 10

so 10+9 = 19

but

$19 \equiv 14 (mod 15)$

so it is 14

note first solution is 16 and it equal to 1 (mod 15)

the solutions are

1,4,11,14

9. Originally Posted by chiph588@
Here are your four solutions, and this is where CRT comes into play

$\begin{cases} x\equiv1\bmod{3}\\ x\equiv1\bmod{5} \end{cases}$

$\begin{cases} x\equiv-1\bmod{3}\\ x\equiv1\bmod{5} \end{cases}$

$\begin{cases} x\equiv1\bmod{3}\\ x\equiv-1\bmod{5} \end{cases}$

$\begin{cases} x\equiv-1\bmod{3}\\ x\equiv-1\bmod{5} \end{cases}$

So applying CRT to these four systems will give you your solutions.
Here's how to solve CRT.

format: plain


text:
# Finding the lifetime of a main sequence star.

## Homework Statement

Given the following data, calculate the main sequence lifetime of the Sun (in years), assuming that all the initial mass is hydrogen and all of it is converted into helium.
Mass of the Sun = M = 2x1030kg
Luminosity of the Sun = L = 4x1032W
Energy released in the proton-proton reaction (4H $\rightarrow He$) is Efusion = 4x10-12J
Comparing the mass of the final helium-4 atom with the masses of the four protons reveals that 0.7% of the mass of the original protons has been lost.

## Homework Equations

L = $\frac{E}{t}$

where L is the stars Luminosity, E is the total energy supplied by hydrogen fusion and t is the stars main-sequence lifetime.

The main-sequence lifetime of a star is also given by:

t = $\frac{fMc^2}{L}$

where f is fraction of of the stars mass converted into energy and c being the speed of light.

## The Attempt at a Solution

- First attempt...

Using the data given, I can just punch it into the equation above, which gave me:

t = [0.007*2x1030*(3x108)2] ÷ 4x1026

This gives me an answer of 3.15x1018 seconds.

Converting this into years yields...

3.15x1018 x $\frac{1}{60*60*24*365}$

which gives 99.9x109 years.

This means the main sequence lifetime of the Sun is about 100 billion years, which can't be correct because in almost every textbook I look in, it states its main sequence lifetime should be 10 billion years. I know that I am by a factor of 10 out somewhere, but I cant seem to find where I have gone wrong.

- Second attempt...
The amount of fusion reactions that take place in the Sun in order to provide the necessary Luminosity is...

L ÷ Efusion = (4*1026) ÷ (4x10-12) = 1038 s-1

Using the above, I can find the total mass of hydrogen converted into helium per unit time (using Wikipedia to find the mass of hydrogen nuclei)...

R = rate at which hydrogen is converted = 4(1.67x10^-27)(10^38) ≈ 670x10^9 kg s-1

I multiplied by 4 in the above because 4 hydrogen nuclei are required for 1 fusion reaction.

The lifetime of the Sun can now be found by dividing the mass of the Sun by the rate at which the hydrogen is converted to helium, so...

$\frac{M}{R}$ = 2x1030 ÷ 670x109 ≈ 3x1018s.

Converting this into years yields...

3.1x1018 x $\frac{1}{60*60*24*365}$

which gives 99.9x109 years.

This is the exact same answer that I got in the first attempt! Either what I have done is correct or I have gone wrong in the two attempts somewhere, but I know that I must be going wrong somewhere because the answer is out by a factor of 10 and its quite frustrating now.

Thanks in advance for any replies and sorry for the bad layout of the 'attempt at a solution' section.

Related Introductory Physics Homework Help News on Phys.org
cepheid
Staff Emeritus
Gold Member
Welcome to PF constantinou1!

## Homework Statement

Given the following data, calculate the main sequence lifetime of the Sun (in years), assuming that all the initial mass is hydrogen and all of it is converted into helium.
Mass of the Sun = M = 2x1030kg
Luminosity of the Sun = L = 4x1032W
Energy released in the proton-proton reaction (4H $\rightarrow He$) is Efusion = 4x10-12J
Comparing the mass of the final helium-4 atom with the masses of the four protons reveals that 0.7% of the mass of the original protons has been lost.

## Homework Equations

L = $\frac{E}{t}$

where L is the stars Luminosity, E is the total energy supplied by hydrogen fusion and t is the stars main-sequence lifetime.

The main-sequence lifetime of a star is also given by:

t = $\frac{fMc^2}{L}$

where f is fraction of of the stars mass converted into energy and c being the speed of light.

## The Attempt at a Solution

- First attempt...

Using the data given, I can just punch it into the equation above, which gave me:

t = [0.007*2x1030*(3x108)2] ÷ 4x1026

This gives me an answer of 3.15x1018 seconds.

Converting this into years yields...

3.15x1018 x $\frac{1}{60*60*24*365}$

which gives 99.9x109 years.

This means the main sequence lifetime of the Sun is about 100 billion years, which can't be correct because in almost every textbook I look in, it states its main sequence lifetime should be 10 billion years. I know that I am by a factor of 10 out somewhere, but I cant seem to find where I have gone wrong.
There is nothing wrong with your arithmetic, but rather with your astrophysics. You are assuming that the main sequence lifetime will end when ALL of the mass of the star is converted from hydrogen to helium. However, this is not necessary. In practice, it is sufficient for the mass in the CORE of the star (the only place that is hot enough for fusion to be occurring in the first place) to be entirely converted from hydrogen to helium. At this point, core fusion ceases, and hence the star goes off the main sequence. So, your value for "M" here would have to be the core mass, rather than the total stellar mass. I'm not sure how much of the mass of the sun is in its core, but presumably the fraction is ~1/10.

EDIT: It looks like your second solution method has the same problem.

Ahh ok, I understand now, thanks alot cepheid for making that clear. Taking that into consideration, the answer that I am coming to now seems to make alot more sense.


text:
• Create Account

## [web] Can't get JavaScript function call to work in Firefox

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1Dim_Yimma_H  Members

Posted 24 September 2005 - 06:35 AM

I've written a javascript function which makes a table in a convenient way and it was OK when I ran it in Internet Explorer but I can't get it to work in Firefox. Luckily, Firefox says in the javascript Console function name "is not defined". What I do is simply call a function (writeText) from another function (createDocument) and writeText is defined above createDocument, if I replace the function call with the code in it then it works. Below is an example which works in IE but not in Firefox, it's very basic so I believe I've misunderstood something crucial about javascript. I would be very happy to hear some guidelines.

<title>test</title>

### #2Anonymous Poster_Anonymous Poster_*  Guests

Posted 24 September 2005 - 06:52 AM

Have you tried putting, y'know, semi-colons after your statements? ;)

IE will try to assemble something meaningful from a lot of code, but usually not very well - FireFox is a lot more picky about syntax. Fortunately.

### #3konForce  Members

Posted 24 September 2005 - 06:53 AM

It looks like a limitation of FireFox's document.open(). As soon as that is called, the rest of the javascript functions seem to disappear. This is either a bug or just how FireFox happens to handle an ambiguous/non-standard case (if it is one). According to the specs: "Open a document stream for writing. If a document exists in the target, this method clears it." It does work under Opera.

If you re-write it like:

function createDocument(title){	function writeText(text)	{		d.write(text)	}}

it works. So basically, your function calling code is correct. The only reason why it cannot find the function is because of the document.open().

### #4markr  Members

Posted 24 September 2005 - 07:03 AM

You're essentially falling into the javascript trap of trying to do more than one thing at once - the results are pretty much guaranteed to be undefined.

Calling document.open on the currently active document, will wipe it out. And everything else will go away with it.

One option is to use a javascript: URL to return the HTML you need - this seems more likely to work (but it's still evil).

Better still, don't use this method at all, and either use DOM manipulation to effect what you need, or server-side code.

Anyway, what's wrong with

?

Mark

### #5Dim_Yimma_H  Members

Posted 24 September 2005 - 08:57 AM

konForce, that made a lot of sense, and thanks for the suggestion about defining a local function, but I will have to redefine it in every function I want to call it from. I thought if I made a separate JS file, I should be able to take the functions with me to the new blank document by putting a script src tag in the new document too, unforunately that didn't work either. I'll probably do like you said and define local functions.
Quote:
 Original post by markrBetter still, don't use this method at all, and either use DOM manipulation to effect what you need, or server-side code.Mark

That might be a good idea, I can try to do the same thing using the innerHTML property.
Quote:
 Original post by markrAnyway, what's wrong with *** Source Snippet Removed ***?Mark

The documents contains images, so instead of linking to many finished documents (pain to update'em all) I decided to convert an array of names into links and create the targets dynamically. What I like about it is that I get a lot less documents to handle. But since many people use Firefox I want to make sure it works for it too.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
Home SQL Locking Scope, race condition prevention

# SQL Locking Scope, race condition prevention

Jacob G
1#
Jacob G Published in 2011-12-05 21:44:40Z
 I have a process that is inserting data into a database (SQL Server 2008) whose schema I cannot modify. The table has an int PK, but no auto-increment. So, I need to get the largest id, increment it and then insert (and return the new id.) This transaction also needs to update a number of other tables at the same time. I'm obviously trying to avoid the race condition of simultaneous inserts. Begin Transaction (Read Committed) DECLARE @MyVar int; --here be the race condition SET @MyVar = (( SELECT MAX(value) FROM MyTable WITH (ROWLOCK, XLOCK, HOLDLOCK)) + 1); INSERT INTO MyTable .... UPDATE MyOtherTable SET Val = @MyVar WHERE WhatEver SELECT MyRetValName = @MyVar INSERT INTO MyThirdTable ... Commit Transaction  Are the transaction isolation level and the table locking hints enough to prevent the race condition or do I need UPDLOCK instead of ROWLOCK? (I have a separate 'retry' process if the insert fails.)
Martin Smith
2#
Martin Smith Reply to 2011-12-05 21:57:43Z
 SELECT MAX(value) FROM MyTable WITH (XLOCK, HOLDLOCK)  Ought to be sufficient. The HOLDLOCK gives serializable semantics which means a key range lock will be taken on the range at the end of the index backing up the primary key. The XLOCK means that 2 concurrent transactions can't both acquire this lock simultaneously. This does mean that any concurrent callers to your insert procedure will end up being blocked for the duration of the transaction. A less blocking solution if you can add a new table would be to create another table with an identity column and insert into that as below. CREATE TABLE dbo.Sequence( val int IDENTITY (10000, 1) /*Seed this at whatever your current max value is*/ ) GO CREATE PROC dbo.GetSequence @val AS int OUTPUT AS BEGIN TRAN SAVE TRAN S1 INSERT INTO dbo.Sequence DEFAULT VALUES SET @val=SCOPE_IDENTITY() ROLLBACK TRAN S1 /*Rolls back just as far as the save point to prevent the sequence table filling up. The id allocated won't be reused*/ COMMIT TRAN
 You need to login account before you can post.
Processed in 0.302564 second(s) , Gzip On .


text:
Chapter 78

Most cases of mitral stenosis (MS) are caused by rheumatic heart disease (Fig. 78–1).1 However, rheumatic fever has become quite rare in developed nations and so too has MS become rare. Indeed, most MS in the United States occurs in patients who have emigrated here from countries where rheumatic fever is still commonplace. Why rheumatic fever has waned in developed nations is unclear. Although antibiotic use almost certainly plays a role,2 the decline in disease incidence began before antibiotics were widely available, suggesting that socioeconomic factors also play a key role in the disease process. In addition, the organism responsible (group A Streptococcus) itself may have mutated to a less rheumatologic agent.

###### Figure 78–1.

The typical fish mouth appearance of rheumatic mitral stenosis is shown. Reproduced with permission from Otto.1

Although it is clear that rheumatic fever causes the disease, the exact mechanisms are still controversial. It is generally agreed that rheumatic fever occurs after infection with group A Streptococcus.3-5 The bodily defense against the organism attacks "M" protein antigens shared by the bacterium and the heart in some patients.4 Thus there is an inflammatory response that leads to cardiac damage, potentially of all three cardiac layers, the pericardium, myocardium, and endocardium. However, it is the endocardium, from which the cardiac valves are derived, that is most severely affected. Although all four valves may become damaged, the mitral valve is virtually always affected, but the reasons for this propensity are unclear. Perhaps greater mechanical stress on the mitral valve causes the inflammatory process to be manifested more severely there than on other valves.

The initial attack causes inflammation, thickening, and retraction of the mitral leaflets, usually causing mild mitral regurgitation, which may disappear as the attack subsides. Why MS develops later is not entirely clear, but at least 3 factors contribute to the process: sex, the severity of carditis in the first attack, and the number of subsequent attacks. Mitral stenosis is primarily a disease of women, with a 3:1 female preponderance. If after the initial attack there is little evidence of valvulopathy and no subsequent attacks occur, the chance that the patient will develop severe MS later in life is probably less than 5%.6 Subsequent attacks can be prevented by faithful adherence to antibiotic prophylaxis. However, what pathologic processes occur between the initial attack of acute rheumatic fever and eventual development of MS (when it does occur) are uncertain. At the time of surgery for MS there are active Aschoff nodules (the pathognomonic lesion of rheumatic fever) in the left atrial appendages of many patients, suggesting that a smoldering rheumatic process persists years after the last acute attack.7 Alternatively, it may be that after the initial lesion is created by rheumatic fever, hemodynamic stress on the valve may lead to continued inflammation and ...

Sign in to your MyAccess profile while you are actively authenticated on this site via your institution (you will be able to verify this by looking at the top right corner of the screen - if you see your institution's name, you are authenticated). Once logged in to your MyAccess profile, you will be able to access your institution's subscription for 90 days from any location. You must be logged in while authenticated at least once every 90 days to maintain this remote access.

Ok

## Subscription Options

### AccessCardiology Full Site: One-Year Subscription

Connect to the full suite of AccessCardiology content and resources including textbooks such as Hurst's the Heart and Cardiology Clinical Questions, a unique library of multimedia, including heart imaging, an integrated drug database, and more.

$595 USD ### Pay Per View: Timed Access to all of AccessCardiology 24 Hour Subscription$34.95

48 Hour Subscription \$54.95

### Pop-up div Successfully Displayed

This div only appears when the trigger link is hovered over. Otherwise it is hidden from view.


text:
# Category Archives: Uncategorized

## Here’s my plan (subject to change)

Yes. I understand that there are conflicts in the list below. And yes, I understand that I will change my mind, or get engaged in a conversation and miss a session. I understand all of that. Nonetheless, here’s my plan for late next week in Denver.

And yes, I will gladly accept recommendations for sessions I may have overlooked. I have highlighted (in red type) people whose work you need to check out if you have not already (with an emphasis on people who my blog readership may not have run across—I’m not gonna highlight Dan Meyer ’cause you know who he is.)

# Thursday

8:00: Teaching and Learning of Algebraic Thinking: Research Insights, Daniel I Chazan, Mark Driscoll, Megan Franke

8:00: Continual Formative Assessment Using the Common Core Mathematical Practices, Karen Fuson

9:30 Algebraic Thinking When Solving Equations and Doing Word Problems, Daniel I Chazan

11:00 Measuring Length and Time in the Common Core, Grades K–1, Constance Kamii

12:30 Keeping It Real: Teaching Math through Real-World TopicsKarim Kai Ani. (Note: I would like to point out that this session will be painful for me to attend, as he mopped the floor with my sorry-ass pony tail in our Chicago debate. Also, I could not get into his session in Philadelphia last year, so SHOW UP EARLY!)

12:30 Meeting the Challenges of the Common Core Standards, Alan H. Schoenfeld

1:00 Research in Algebraic Thinking: Continuing the ConversationMegan Franke, Mark Driscoll, Daniel I Chazan

2:45 mARTh: Using Creative Expression to Connect Students to Mathematical Concepts, Hannah McNeill

# Friday

8:00 Teaching and Learning of Proof: Research InsightsE. Paul Goldenberg, Patricio Herbst, Eric Knuth

9:30 Essential Mindsets for Tilling the Soil for the Common Core, Steven Leinwand

11:00 Keeping Our Eyes on the Prize, Philip Uri Treisman

02:00 Creating Opportunities for Students to Engage in Reasoning and ProofMargaret Schwann Smith

2:45 Powerful Online Tools Promote Powerful Mathematics, Eli Luberoff, Patrick Vennebush

# Saturday

8:00 They’ll Need It for Calculus, Christopher Danielson

11:00 Tools and Technology for Modern Math Teaching, Dan Meyer

12:30 Viral Math Videos: A Hart-to-Hart Conversation, Vi Hart, George Hart

## What do we need functions for?

In this online functions course I have been teaching, and which is nearly halfway complete, a question has been kicking around in various forms. What do we need functions for?

There are many versions of this question. What do we need functions for (in middle school math)? What do we need functions for (in solving visual patterns tasks)? Et cetera.

One permutation of this question comes from the blogosphere’s own Michael Pershan. What do we need functions for (in mathematics more broadly)?

Here was my response to that question in class this morning. I do not consider this to be the definitive answer to it. Instead, it is an example. One of many, no doubt.

Apologies for the imperfect typesetting on the mathematics below. It’s good enough to get the point across and I don’t have time to look up all the relevant TEX commands to get it looking just right.

You know what blew my mind about functions on returning to higher math in graduate school? That we can make them our servants. We can make functions work for us. My introduction to the idea that we can create functions that—like robots—we can program to make something useful happen was the characteristic function. I am going to assume most of you have not taken graduate Real Analysis, so let me explain quickly.

The characteristic function of a set is defined to have the value 1 when the input is in the set, and to have the value 0 otherwise. Formally, that looks like this:

That capital Xish thing is the Greek letter “Chi”. Here is the graph of .

So what, right? Well, the characteristic function links sets with functions. We can begin to talk about the size of a set based on the results of operations on the set’s characteristic function.

One question that mathematicians have been interested in dealing with over the years is how big is the set of rational numbers? By using the characteristic function , we can rephrase that question in terms of functions. Without giving away the first three weeks of graduate analysis, you can imagine the graph of this function as being a whole bunch of points on the x-axis and a whole bunch of points at y=1. Indeed, there are so many of each that you can’t see that the function is a function. It looks like two functions (Note; I have cheated and just plotted y=1 and y=0 below—I do not believe Desmos can work with the condition that x must be rational).

The question about the characteristic function on the rational numbers that corresponds to asking How big is the set of rational numbers? is this: What is the value of the integral of the characteristic function? That is, we ask what is the value of the following expression?

$\int_{[0,1]} \chi_{(Q)} (x)\,d \mu\$

Geometrically, we are asking how much area is shaded below (given that the points at y=1 correspond ONLY to the rational values of x in the interval 0≤x≤1).

The standard definition of integrals (the Riemann integral) cannot answer this question. One way of computing gives 0, another way gives 1, so we have to say that the integral does not exist. This function is not integrable in standard calculus.

So we invent the Lebesgue integral, which is defined in terms of sets rather than areas of rectangles. And we learn that the value of this integral is zero.

That is, the set of rational numbers is so small that we can say—relative to the size of the set of real numbers—that there are essentially none of them. The rational numbers are so few that we say the size of the measure of the set is zero.

They are infinite yet insignificant.

The machinery to prove all of that is the characteristic function.

That’s one thing that functions are good for.

Dig.

## I didn’t really realize how much we need this…

This booklet, from Early Childhood Family Education, came into our home over the weekend.

Forgive the decorations, please. They are not mine.

Naturally, I was curious to see what it had to say about early math development.

Nothing.

Zero, zip, zilch. Not one word.

There are entries on Joining libraries (“They make literacy fun!”), Literacy (A full two-page spread), Writing, and Words (“Words are powerful!”)

Nothing on Number, Shape, Pattern, Counting, Math or Numeracy. I hereby humbly submit the following entries.

Counting. Children learn counting language before they learn about numbers. They learn this language through example and repetition. You and your children can count together soon after they begin to talk. Model correct counting and don’t worry about your child’s incorrect counting. Have fun with numbers. And when a child asks, “Want to see how high I can count?” the correct answer is always Yes!

Shape. Children find shapes fun. While you are at the library picking up alphabet books, grab a couple of shapes books, too. Noticing shapes in the world is the first step to success in geometry and measurement, important parts of the math your children will learn in elementary school.

Children love to get their hands on interesting shapes, too. Shape puzzles and toys can help young children to notice and investigate properties of shapes such as size, symmetry and angles.

Before children enter school, they do not need memorized number facts. They do need to have lots of experience counting and talking about numbers.

## Triscuit squares

After chatting with the Mathalicious crew about a lesson on square roots and irrational numbers, I was inspired to talk math with Tabitha (5 years old).

Me: [With a box of Triscuits at the dining room table] Tabitha! Come here, please! I want to talk to you about something.

Tabitha: I know what this is gonna be about.

Me: What?

T: Math.

Me: Right. I want to know whether you can arrange those in a square.

I hand her four Triscuits.

She quickly forms them into a square.

T: Done. Now can I eat them?

Me: Not yet. Can you do it with these?

I give her nine Triscuits and scramble them up.

She is again successful.

Me: How many more are in this square than in the last one you made?

T: I am really tempted to eat them.

Me: Right. But how many more are there this time?

T: There were 4 before. And now there are 9.

Me: Yes. So how many more in the big one?

Some elaborate Triscuit shuffling goes on, lasting about a minute.

T: Five. Wanna know how I did it?

Do you see the beauty of doing this on a regular basis? Children learn discourse patterns through exposure. Not only can she explain her thinking, she expects to do so.

Me: Yes.

T: I took 4 away, then there were five left.

Me: Nice. One more.

T: I really want to eat these.

Me: I know. Soon. Can you make a square with these?

I give her 7 Triscuits.

She moves them around. She is not especially systematic in the order she places them.

She ends with this arrangement.

T: If you took this one [i.e. the one in the upper left] away, you’d have a square.

Me: Is that a square?

T: Oh! No. It’s a rectangle.

You do it.

Me: I can’t. See I can do a square with 1 Triscuit.

T: Of course.

Me: Then I can do 4 like you did, and 9 like you did. Four had two Triscuits on a side. Nine has three Triscuits on a side…

But she can no longer hear me over the sound in her head of the crunching of Triscuits.

## We have to call this stuff out

Strange start to the day.

First was Kate Nowak noticing the hate Vi Hart routinely heaps on math teachers. As happens at 2:04 in the video below. Note especially her tone here.

Then the following comes across my desk (click on it to see the full size version).

The first line reads, “Statistics show that more students are coming from high school with weaker mathematical backgrounds than ever before.”

No citation. No argumentation. Just Statistics show.

I have replied with the following:

Wow. Gotta admit that first line is provocative.

What evidence are you basing this claim upon?
Thanks,
Christopher Danielson
I’ll keep you posted.
In the meantime, we need someone with some mad video skills to make a “Sal and Vi Hate Math Teachers” video in the spirit of “Hollywood Hates Math“. I’ll help with the archival work. Who’s in?


text:
2 alpha fixup, >0 matrices are pd

Hello! (First question--please forgive me if its unclear.)

I am interested in efficient/approximate optimization techniques for minimizing a norm of a convex combination of symmetric, positive semi-definite matrices. In particular I am wondering what techniques exist to efficiently solve the following problem:

$\alpha^{*}=\arg\min\big\{\operatorname{trace}((\sum_i\alpha_i \mathcal{I}_i)^{-1}):\sum_i\alpha_i=1 mathcal{I}_i)^{-1}):\sum_i\alpha_i=1, \alpha_i\ge0 \big\}$

where $\mathcal{I}_i$ are positive semi-definite matrices and $\operatorname{trace}$ is the sum of the eigenvalues. Edit: Furthermore, assume $\mathcal{I}_i\succ0$ for at least one $i$.

Approximations are acceptable--I am interested in any "standard" approaches, should they exist. Should some other scalar function be more convenient this would be interesting to me too (ie determinant, nuclear norm, spectral radius, etc). The matrices are often sparse and could be extremely large.

The simplest idea I had was to lower bound the sum of matrices using Weyl's theorem, ie, $\lambda_i(A+B)\ge \lambda_j(A)+\lambda_{n+i-j}(B)$ for $j\ge i$ giving me an upper bound to the trace of the inverse of the sum. I am wondering if another bound would be tighter or better still some clever variational approach exists.

The motivation (shouldn't be relevant to the answer) for this problem comes from statistical machine learning. I would like to develop techniques for characterizing maximum composite likelihood estimators (a generalization of the maximum likelihood estimator). Classical statistical analysis yields a convex combination of the expected Hessian matrices and is as above. (The $\mathcal{I}$ denotes the Fisher information matrix.)

There is some similarity to the Eigenvalues of Matrix Sums question although I believe this question is sufficiently different to ask anew.

Thanks,

Josh

1

# Minimize trace of inverse of convex combination of matrices.

Hello! (First question--please forgive me if its unclear.)

I am interested in efficient/approximate optimization techniques for minimizing a norm of a convex combination of symmetric, positive semi-definite matrices. In particular I am wondering what techniques exist to efficiently solve the following problem:

$\alpha^{*}=\arg\min\big\{\operatorname{trace}((\sum_i\alpha_i \mathcal{I}_i)^{-1}):\sum_i\alpha_i=1 \big\}$

where $\mathcal{I}_i$ are positive semi-definite matrices and $\operatorname{trace}$ is the sum of the eigenvalues.

Approximations are acceptable--I am interested in any "standard" approaches, should they exist. Should some other scalar function be more convenient this would be interesting to me too (ie determinant, nuclear norm, spectral radius, etc). The matrices are often sparse and could be extremely large.

The simplest idea I had was to lower bound the sum of matrices using Weyl's theorem, ie, $\lambda_i(A+B)\ge \lambda_j(A)+\lambda_{n+i-j}(B)$ for $j\ge i$ giving me an upper bound to the trace of the inverse of the sum. I am wondering if another bound would be tighter or better still some clever variational approach exists.

The motivation (shouldn't be relevant to the answer) for this problem comes from statistical machine learning. I would like to develop techniques for characterizing maximum composite likelihood estimators (a generalization of the maximum likelihood estimator). Classical statistical analysis yields a convex combination of the expected Hessian matrices and is as above. (The $\mathcal{I}$ denotes the Fisher information matrix.)

There is some similarity to the Eigenvalues of Matrix Sums question although I believe this question is sufficiently different to ask anew.

Thanks,

Josh


text:
# Math Help - finding a sequence of continuous bounded functions

1. ## finding a sequence of continuous bounded functions

I want to find a sequence (f_k)of continuous bounded functions on [0,1]

converging pointwise to a continuous limit, but such that

the sup-norm of f_k tends to infinity when k tends to infinity...

is there any?

2. Nope, i don't think there are any. Since if $f_k \rightarrow f$ pointwise then
$\lVert f_k \lVert_{sup} \rightarrow \lVert f \lVert_{sup}$ which would mean f is not bounded on [0, 1] (since $\lVert f_k \lVert_{sup} \rightarrow \infty$ ) thus it must not continuous on [0, 1].

3. Originally Posted by losin90
I want to find a sequence (f_k)of continuous bounded functions on [0,1]

converging pointwise to a continuous limit, but such that

the sup-norm of f_k tends to infinity when k tends to infinity...

is there any?
What you need to do is to ensure that the function $f_k$ has a narrow spike somewhere. For example, define $f_k(x) = k^2x$ in the interval $0\leqslant x<1/k$, $f_k(x) = \tfrac2k - k^2x$ in the interval $1/k\leqslant x<2/k$, and $f_k(x) = 0$ in the remainder of the unit interval. Then $f_k(x)\to0$ as $k\to\infty$, for each (fixed) point x in the unit interval.

Originally Posted by jakncoke
Nope, i don't think there are any. Since if $f_k \rightarrow f$ pointwise then
$\lVert f_k \lVert_{sup} \rightarrow \lVert f \lVert_{sup}$ which would mean f is not bounded on [0, 1] (since $\lVert f_k \lVert_{sup} \rightarrow \infty$ ) thus it must not continuous on [0, 1].
That is not true, because pointwise convergence does not imply convergence in the sup norm.


text:
# A tube has a radius of 3 inches and a height of 7 inches. What it's approximate volume?

$$197.92 in^{2}$$

Explanation

The volume of a tube is given by the formula $$V=\pi r^{2} \times h$$ where r is the radius of the tube and h is its height. By definition, $$\pi$$ is approximately 3.14 so:
$$V = 3.14 \times {3^2} \times 7 = 3.14 \times 9 \times 7 = 197.92 { in^2 }$$