As far as I know, mini-batch can be used to reduce the variance of the gradient, but I am also considering if we can achieve the same result if we use the decreasing step size and only single sample in each iteration? Can we compare the convergence rate of them?
Hi there I am developing a theme where I have to load some posts with ajax, in my index page everything works properly, the problem is when I need to use it on custom post type, I pass the values for a jquery file using wp_localize_script, it pass the correct value when I have regular posts, but it always pass 0 when I have a custom post type. Can you help me? Many thanks. Code to pass arguments to my …
I want someone to correct my code in python. My goal is to create a code that will add a new column that is based on the conditional function of two columns in my dataframe. I want to add a fees column which is a numeric column that is different and based on whether the success is True or False and based on the PSP column as well. Note that data type are as below: success = boolen PSP = …
I'm querying a custom post type ("donor") and would like to list them grouped by category (a custom taxonomy for this post type), with the category title then all posts for that category. After much research, I've got this (in my custom post type's archive template, archive-donor.php): global $paged; global $query_args; $category_args = array( 'taxonomy' => 'donor_taxonomy', 'orderby' => 'name', 'parent' => 0 ); $categories = get_categories( $category_args ); foreach ( $categories as $category ) { echo '<h3><a href="' . …
From the definition of resent from wikipedia: it is mentioned that resent model uses fewer layers in the initial training stages. This speeds learning by reducing the impact of vanishing gradients, as there are fewer layers to propagate through. The network then gradually restores the skipped layers as it learns the feature space. I am new to this domain, and have tried using resent50 and resnet18 for toy examples, but I am not sure about these theoretically parts. Can someone …
I think I'm missing a step here, but for the life of me I can't see it. I'm trying to display a simple list of users who all have the same role and have the same meta data value for a certain key - namely, teachers associated with a school. Here is my code: <div class="teachers-list"> <h3>Your School's Teachers</h3> <ul> <?php $champion_user = wp_get_current_user(); $school = $champion_user->school; // echo $school just to test it's right.... ?> Your school: <?php echo …
I have a simple dataset that I'd like to apply entropy discretization to. The program needs to discretize an attribute based on the following criteria When either the condition “a” or condition “b” is true for a partition, then that partition stops splitting: a- The number of distinct classes within a partition is 1. b- The ratio of the minimum to maximum frequencies among the distinct values for the attribute Class in the partition is <0.5 and the number of …
To make better looking category pages in my sites, I'm looking for a way to show the content of a regular page on the permalink /category/name. How can I achieve that ? Thanks
The below is a picture which denotes the error of an ensemble classifier. Can someone help me understand the notation What does it mean to have (25 and i) in brackets and what is ε^1 is it error of first classifier or the error rate raised to power i. Can someone explain this formulae.
I have tried to just copy the whole root folder into a subdirectory. I understand the .htaccess file has to be changed. But can't get it to work right. Is it something more than changing the htaccess file I'll have to do to make this possible? As I said in the question, I want to use the same database. So I can't change any URL's in the database. Edit: I have figured out that the site actually is going in …
I am working with the LDA (Latent Dirichlet Allocation) model from sklearn and I have a question about reusing the model I have. After training my model with data how do I use it to make a prediction on a new data? Basically the goal is to read content of an email. countVectorizer = CountVectorizer(stop_words=stop_words) termFrequency = countVectorizer.fit_transform(corpus) featureNames = countVectorizer.get_feature_names() model = LatentDirichletAllocation(n_components=3) model.fit(termFrequency) joblib.dump(model, 'lda.pkl') # lda_from_joblib = joblib.load('lda.pkl') I save my model using joblib. Now I want …
I am tasked with using 1-of-c encoding for a NN problem but I cannot find an explanation of what it is. Everything I have read sounds like it is the same as one hot encoding... Thanks
I am a trying to write a CNN from scratch in python but I am bit new to CNNs specifically the convolution layers as I am comfortable with the dense layers. I was reading Do filters have different weights for each input channel but I didn't completely understand and had a few questions. I wanted to confirm that if the input layer had 3 channels then for there to be 4 output channels you would need a total of 12 …
I am trying to understand the proof of Theorem 3 in the paper "A Universal Law of Robustness via isoperimetry" by Bubeck and Sellke. Basically there exist atleast one $w_{L,e}$ in $\mathcal{W}_{L,e}$ for which there is another $w_{L}$ in $\mathcal{W}_{L}$ $\frac{\epsilon}{6j}$ apart. And this this makes clear, $$||f_{w_{L,\epsilon}} - f_{w_{L}} ||_{\infty} = J * \epsilon/ 6J = \epsilon/6 \cdot \cdot \cdot\cdot\cdot\cdot\cdot\cdot\cdot (a) $$ using this assumption $1$ $$\boxed{ \left\|f_{\boldsymbol{w}_{1}}-f_{\boldsymbol{w}_{2}}\right\|_{\infty} \leq J\left\|\boldsymbol{w}_{1}-\boldsymbol{w}_{2}\right\|} $$ This equation (a) denotes that those two functions …
I have a site that displays manual excerpts on the blog post page: https://teralynnchilds.com/blog. I added a custom read more link using the snippet found here: https://wpmayor.com/add-read-link-manual-excerpts/ The RSS feed (https://teralynnchilds.com/feed) includes the manual excerpt, the custom read more link, AND a default read more link of "keep reading TITLE at SITE". I am trying to remove that default read more link from the feed but cannot find the source anywhere. How do I fix it some my feed only …
I have a custom post type set up (two, actually) that are not displaying properly. I am hoping that it is the same issue with both post types. Here is my code for one of the post types (portfolio). The second is quite similar. <?php add_action('init', 'ccd_portfolio'); function ccd_portfolio() { $labels = array( 'name' => _x('Portfolio', 'post type general name'), 'singular_name' => _x('Project', 'post type singular name'), 'add_new' => _x('Add New', 'ccd_portfolio item'), 'add_new_item' => __('Add New Project'), 'edit_item' => …
I'm writing my own php class and I have multiple functions within the class. Something like this: class JSON_API_Hello_Controller { public function test_cat(){ global $json_api; $posts = $json_api->introspector->get_posts(array( 'cat' => 3)); return $this->posts_object_result_bycat($posts); } public function test_cat1() { global $json_api; $posts = $json_api->introspector->get_posts(array( 'cat' => 2)); return $this->posts_object_result_bycat($posts); } protected function posts_object_result_bycat($posts) { global $wp_query; return array( 'count' => count($posts), 'pages' => (int) $wp_query->max_num_pages, 'posts' => $posts ); } public function mix_cat(){ $first_cat = $this->test_cat(); $second_cat = $this->test_cat1(); $json1 = …
Create model: model=Sequential() model.add(Dense(input_dim = 12, units = 10, activation='relu', kernel_initializer='uniform')) model.add(Dense(units = 8, activation='relu', kernel_initializer='uniform')) model.add(Dense(units = 1, activation='sigmoid', kernel_initializer='uniform')) print('Training the model...') Compile model: model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) while running the model.fit() Fit the model: model.fit(X_train,y_train,batch_size=32, epochs=10, verbose=1) I am getting the error: ValueError: Error when checking input: expected dense_36_input to have shape (None, 12) but got array with shape (140, 2)
I am trying to learn the basic of pytorch so I can assemble my own CNN's. One thing I am also trying to learn is navigating the API documentation. Specifically at the moment I am trying to read through nn.Conv2d. I quote the documentation: Applies a 2D convolution over an input signal composed of several input planes. In the simplest case, the output value of the layer with input size $(N,C_{in},H,W)$ and output $(N,C_{out},H_{out},W_{out})$ can be precisely described as $$ …
What are the options to capture all posts or pages on a specific path - including multiple levels of parent pages - and update status (published -> draft)? Thanks
I am writing a test custom layer which implements the Simple Exponential Smoothing algorithm. The problem: when I train it, the alpha (smoothing) coefficient always converges to value 1. This means that the one step forward forecast always takes the previous actual value. I most probably miss something obvious but couldn't figure it out, yet. Any idea? Thanks. The code: from tensorflow.keras.layers import Layer class SES(Layer): def __init__(self, dtype=tf.float32): super(SES, self).__init__() def build(self, input_shape): alpha_init = tf.keras.initializers.random_uniform(minval=0., maxval=1.) self.alpha = …
kind of a rookie question but here goes: I'm working on a Wordpress theme from scratch on my local machine, and I'm setting up a static page for the Blog. I have my archive.php file for all the posts and then a single.php for individual posts. However, when I put these files in my root folder (themes -> theme name), along with index.php, the file always seems to default to index.php. In addition to that, I was trying to use …
I am learning AgglomerativeClustering using sklearn. It is fairly easy to use for example: # create clusters hc = AgglomerativeClustering(n_clusters=10, affinity = 'euclidean', linkage = 'ward') # save clusters for chart y_hc = hc.fit_predict(points) In my case,n_clusters is dynamic within a range, say from 9-15. I would like to run some cost function or score function, so I can plot a chart and then pick one there. However, seems AgglomerativeClustering doesn't have a score function, unlike Kmeans, which I can …
The existing WooCommerce orders table in the wp-admin dashboard orders the results by the date the order was made, but I want to modify the query to order by date and also by the shipping method of the order, where same-day delivery takes priority over standard delivery, etc. I'm aware I can use the wc_get_orders() function to get all the orders myself and change the query however I like, but I need this new ordering system to work on the …
I'm using: get_theme_mod to show various pieces of info from the theme customizer, in the following format: <a href=" <?php get_theme_mod( $name, $default ) ?> ">This is the link</a> I would like to hide the whole line if that particular customizer field is empty. What could I wrap around the anchor to accomplish this?
I have a site where the options_id field in the wp_options table has grown very, very large. A month and a half after the installation, the auto_increment value is now at over 10 million. While there are a number of plugins installed (such as ACF and W3 Total Cache) they do not seem to be the cause. They have been installed on others sites together with the same theme framework without any issues. I have a local dev environment of …
I have gathered a large amount of qualitative data and am now looking to cluster it so as to make sense of it. For this, I am using Biolab's Orange. In my data, specific values may co-occur in a given feature, or they may not. I am wondering how I could cluster the data (either in Orange or other software), where values that co-occur would be seen as two values, rather than one string. To make matters clearer, imagine I …
I am beginner here starting with data science for analytics. I am trying to figure out what data set this is and how to read it from python. I have an idea of the steps but not sure how to code it in python. Open & read the file Search for keywords based on another file If keyword found, search for Term from that line up and copy value of id: which is below it. If more than one keyword …
What will be the best approach to classify blocks of a univariate time series that contains data of a fuel tank level (data captured every 30 seconds)? The slope of the curve would be an important feature but only after removing noise. An example TSD looks like this. Marked in red is "Sudden drain" classified manually. I need to classify blocks of the time series on following 5 categories. Idle (no change in fuel level) Suddent drain (very fast reduction …
Can we use weka for multivariate data analysis? When we have more than one variable as the dependent variable... ( without using factor analysis to reduce the number of variables associated with the dependent variable). Thank you
In sentence classification using pre-trained embeddings(fasttext) in a CNN, how does the CNN predict the category of a sentence when the words were not in the training set? I think the trained model contains weights, these weights are not updated in the prediction stage, are they?. Then, what happens when the words in the sentence (for which the cnn will predict a category) were not seen in the training? I think they do not have a word vector, only the …
Basically, I'm trying to call attachment info to display withing a loop, for use in an image gallery. I know I need to use wp_prepare_attachment_for_js($attachment_id) but I can't seem to get anything to show. Here's the HTML: <?php $the_query = new WP_Query(array( 'post_type' => 'attachment', 'post_status' => 'inherit' )); while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php attachment_meta = wp_get_attachment($id); echo '<figure class="gallery-photo" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject" data-groups='["all", "'.$attachment_meta['category_name'].'"]'><a class="photo-link" href="'.wp_get_attachment_image ().'">" itemprop="contentUrl" data-size="'.$attachment_meta[width].'"x"'.$attachment_meta[height].';?>"> <img src="'.wp_get_attachment_url ('fullsize').'" itemprop="thumbnail" /> <figcaption itemprop="caption …
I'm trying to build a machine learning model for recognizing simple voice commands like up, down, left, etc. On similar problems based on images, I'd just take the picture and assign a label to it. I can generate features and visualize them using librosa. And I hear CNNs are amazing at this task. So, I was wondering how I'd gather training data for such audio based systems, since I can't record an entire clip considering my commands are only going …
I am doing a migration from a wordpress/woocommerce website, I've successfully export/import all the data except one thing : the download attachment file from my woocommerce product I'm using the wp-cli it's working fine for the normal media (all my page and blog article have their media files) but all my woocommerce files are uploaded in wp-content/uploads/year/month folder instead of : /wp-content/uploads/woocommerce_uploads/year/month I've looked in the XML the path is correct Is someone know how wordpress decides in which directory …
I am trying to use run a GoogLeNet code using FERET datasets. When I run the code, I get the following error message: Traceback (most recent call last): File "C:\Users\JoshG\PycharmProjects\GoogLeNet\GoogLeNet5.py", line 221, in <module> y_pred = (model.predict_classes(testX)) AttributeError: 'Functional' object has no attribute 'predict_classes'' Can anyone tell me what I am doing wrong? I am new to python, so please patient with me understanding. Below is the full code: # Python: 3.9 # keras: 2.2.4 for GoogLeNet on CIFAR-10 # …